tarkah/lazystream

M3U Output With Highest Quality Produces Broken Composite Links

SoSJames opened this issue · 16 comments

When M3U output is selected with --quality 720p60 option, the returned composite stream links are broken. The maximum quality available is 3500K, and so hard-coding 5600 into the link won't work. Perhaps a conditional statement to replace 5600 with 3500 in the link generator for composite links would do the trick.

Hmm, nothing is hardcoded and I parse the master.m3u8 for these links. I'll see if I can reproduce and identify the problem.

Ahh sorry, I reread your message and understand. Yes, we need to fallback when the selected quality isn't available. I'll make sure to always fallback to the next highest quality.

Or I can just fallback with the master.m3u8, and it'll be adaptive. Do you have a preference for how it should work? I know adaptive can sometimes cause issues so if someone is passing a specific quality, it might be best to fallback to the next best quality vs back to adaptive.

In my case, a fallback to the max of 3500 would be best, because certain clients have trouble with NHL/MLB's m3u8 tags and fail to identify the best quality. It's rare, but I guess if the script has the ability to specify quality, the results should not be mixed (i.e. all single bandwidth m3u8s and some adaptive m3u8s mixed in). And thanks for the fast response, by the way!

Maybe it's out of scope for this issue but would it be easy to add a flag to ignore composite streams (I figured I would ask since you might be messing in that area)? I never watch those streams and I assume others are in the same boat

I concur, but as long as the channel list now forces there to be 100 channels there at all times, might as well use them, no?

@Foxcon84 Yeah, I can easily add an --exclude-feeds option, which you can provide a list of those on the CLI

Ok, so I will use the following order of operations when a quality is specified for playlist / xmltv output...

  • Use link for specified quality
  • If not available, use quality link for next high bitrate BELOW the specified quality ( 720p60 > 720p >540p > 504p > 360p > 288p > 224p > 216p )
  • If all else fails, use the master m3u8 link (adaptive)

Makes sense to me

Thanks Tarkah, that's perfect.

Awesome! So I've got it working, here is the diff from yesterdays playlist file when using 720p60 as quality...

❯ diff test.m3u test2.m3u 
5c5
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146418~acl=/*~id=nhlGatewayId:2807936~data=2013171871~hmac=7c70912a56b5e23de0ea928381ff7630125f33f3107115b8d9e9f9958946a470/85f515a1aab6759648ba590af47608c0/ls03/nhl/2021/01/18/NHL_GAME_VIDEO_CBJDET_M2_COMPOSITE_3X_20210118_1610309826844/3500K/3500_complete-trimmed.m3u8
11c11
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146464~acl=/*~id=nhlGatewayId:2807936~data=2013171941~hmac=d99e14ba4cd598efb628ee783548e601dbf5bd45f1e81b93e2962c0ef7aff1b4/f30ed26ea63cc24b68f3b0acbb1586e5/ls03/nhl/2021/01/18/NHL_GAME_VIDEO_BOSNYI_M2_COMPOSITE_3X_20210118_1610310009422/3500K/3500_complete-trimmed.m3u8
19c19
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146519~acl=/*~id=nhlGatewayId:2807936~data=2013175101~hmac=f1df5fe7447f52dc38e89ffd19b52433136936e650f3149f3d5b34ae021294fe/e50777fc334f7cf88a57fc6d8203707a/ls03/nhl/2021/01/19/NHL_GAME_VIDEO_WPGTOR_M2_COMPOSITE_3X_20210119_1610311824162/3500K/3500_complete-trimmed.m3u8
23c23
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146548~acl=/*~id=nhlGatewayId:2807936~data=2013172011~hmac=6deacb8a5d9a45e0cc3a389a97cecabfe7c348f55786714a77e881bcec946d7b/4e78c477dbb4a63753997c6a83b22d3c/ls03/nhl/2021/01/19/NHL_GAME_VIDEO_BUFPHI_M2_COMPOSITE_3X_20210119_1610310753482/3500K/3500_complete-trimmed.m3u8
29c29
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146646~acl=/*~id=nhlGatewayId:2807936~data=2013172081~hmac=95e899a4c0c9dc7e65ea6d4ed5ee0565dff570780b41c78dabc13487b45b6063/208bee8ebfb5a49ac65dc842b8d4fed1/ls03/nhl/2021/01/19/NHL_GAME_VIDEO_CARNSH_M2_COMPOSITE_3X_20210119_1610310834550/3500K/3500_complete-trimmed.m3u8
35c35
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146597~acl=/*~id=nhlGatewayId:2807936~data=2013174751~hmac=dc9c6ce8eee0af0dd1092c25dd12b33b0976f4bba47a8ea1a038088f351e1885/1f7da723a1a53a27db08f782d347bca0/ls03/nhl/2021/01/19/NHL_GAME_VIDEO_SJSSTL_M2_COMPOSITE_3X_20210119_1610311096756/3500K/3500_complete-trimmed.m3u8
41c41
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146696~acl=/*~id=nhlGatewayId:2807936~data=2013174821~hmac=855075bcbfc7253fbce8cf547042b6cd4ce57a10847fe7c84caa52ae2ec79388/fde516a39ea575b4432580df643a0832/ls03/nhl/2021/01/19/NHL_GAME_VIDEO_MINANA_M2_COMPOSITE_3X_20210119_1610311171031/3500K/3500_complete-trimmed.m3u8
49c49
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146771~acl=/*~id=nhlGatewayId:2807936~data=2013175031~hmac=5e7b9df18185d799b33bafbaa7d580ffc189b15444aeae359eeaeb49b0017685/c6556da8c0b7a45ed236cc692645d649/ls03/nhl/2021/01/19/NHL_GAME_VIDEO_MTLEDM_M2_COMPOSITE_3X_20210119_1610311624686/3500K/3500_complete-trimmed.m3u8
53c53
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146725~acl=/*~id=nhlGatewayId:2807936~data=2013174891~hmac=d68dd83ca06be7b2c90a741aedcf2a68626cf6429b873d636bd5b88b6a408ed2/24e9fff9f6afb83e7fde20cd6bd1afb8/ls03/nhl/2021/01/19/NHL_GAME_VIDEO_VANCGY_M2_COMPOSITE_3X_20210119_1610311228207/3500K/3500_complete-trimmed.m3u8
57c57
< .
---
> https://hlslive-akc.med2.med.nhl.com/hdnts=exp=1611146818~acl=/*~id=nhlGatewayId:2807936~data=2013174961~hmac=ba58d9f3c6b73230f3a823489fac2051911e927bab34de0b659d766992355f93/90fc1c4a5315ee4a1fb8972c9335c7a4/ls03/nhl/2021/01/19/NHL_GAME_VIDEO_ARIVGK_M2_COMPOSITE_3X_20210119_1610311394438/3500K/3500_complete-trimmed.m3u8

Great, that's perfect. Thanks for the quick work, you're the best!

No problem! And the new command line option to exclude feed types for both xmltv and playlist, a space separated list of feed names:

lazystream generate xmltv ./test --date 20210118 --quality 720p60 --exclude-feeds COMPOSITE FRENCH
--exclude-feeds <exclude-feeds>...    Feed types to exclude from output [possible values: HOME, AWAY, FRENCH, COMPOSITE, NATIONAL]

I'll push these out into a new release here shortly, just doing some additional testing

Nice! Awesome work as always 😎