Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jiocinema - audio missing on some episodes #10144

Open
10 of 11 tasks
varunchopra opened this issue Jun 9, 2024 · 10 comments
Open
10 of 11 tasks

jiocinema - audio missing on some episodes #10144

varunchopra opened this issue Jun 9, 2024 · 10 comments
Labels
account-needed Account details are needed to test/fix this can-share-account Someone is willing to provide account details for development geo-blocked Content is geo-blocked site-bug Issue with a specific website triage Untriaged issue

Comments

@varunchopra
Copy link

varunchopra commented Jun 9, 2024

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field

Checklist

Region

India

Provide a description that is worded well enough to be understood

I tried to look into this but I'm not sure what's missing. One thing I've noticed that in the browser itself, the app uses DASH but we use HLS in yt-dlp. I've disabled DRM in the browser as well so I know it isn't using a DRM.

There are some episodes, for example: https://www.jiocinema.com/tv-shows/pokemon/3/the-fortune-hunters/3776882 which support multiple audio sources (English + Hindi in this case). However, listing formats does not list Hindi as an audio source:

[jiocinema] 3776882: Downloading m3u8 information
[info] Available formats for 3776882:
ID                         EXT  RESOLUTION FPS |   FILESIZE   TBR PROTO | VCODEC        VBR ACODEC     MORE INFO
-------------------------------------------------------------------------------------------------------------------
hls-audio-aacl-125-English m3u8 audio only     |                  m3u8  | audio only        unknown    [en] English
hls-audio-aacl-45-English  m3u8 audio only     |                  m3u8  | audio only        unknown    [en] English
hls-audio-aacl-61-English  m3u8 audio only     |                  m3u8  | audio only        unknown    [en] English
hls-audio-aacl-93-English  m3u8 audio only     |                  m3u8  | audio only        unknown    [en] English
hls-261                    mp4  480x270     25 | ~ 39.48MiB  261k m3u8  | avc1.4D4015  200k video only
hls-490                    mp4  480x270     25 | ~ 74.13MiB  490k m3u8  | avc1.4D4015  400k video only
hls-735                    mp4  640x360     25 | ~111.19MiB  735k m3u8  | avc1.4D401E  600k video only
hls-981                    mp4  854x480     25 | ~148.40MiB  981k m3u8  | avc1.4D401E  800k video only
hls-1405                   mp4  1280x720    25 | ~212.54MiB 1405k m3u8  | avc1.64001F 1200k video only
hls-2571                   mp4  1920x1080   25 | ~388.93MiB 2571k m3u8  | avc1.640028 2300k video only 

When viewing the above episode in the browser, I can see a request to the following URL (note _hin in the URL, for Hindi):

https://ak-mediavod.jiocinema.com/bpkvod/jcvod/default/64ae00b612daedcd08e2b0fc_v13/64ae00b612daedcd08e2b0fc_v13/dash/64ae00b612daedcd08e2b0fc_v13-audio_hin=45375-1056768.dash?hdntl=exp=1718037427~acl=%2fbpkvod%2fjcvod%2fdefault%2f64ae00b612daedcd08e2b0fc_v13%2f64ae00b612daedcd08e2b0fc_v13%2f*~id=00766a32e154458f8f04ff611ffe5e4e~data=hdntl,rqId%3d8b3edc51-c8b5-4bb0-a94c-c7630009e363~hmac=68d2db282d2f87366879893fd93368cb189c7dad3b430d74681ae9050c47a2cc

There are other episodes from the same series which support A/V video sources (as opposed to video only)[see: example 2], and some which support video only + have multiple languages supported.

Example 2 (https://www.jiocinema.com/tv-shows/pokemon/4/a-goldenrod-opportunity/3776579):

[jiocinema] 3776579: Downloading m3u8 information
[info] Available formats for 3776579:
ID                        EXT  RESOLUTION FPS |   FILESIZE   TBR PROTO | VCODEC        VBR ACODEC     ABR MORE INFO
---------------------------------------------------------------------------------------------------------------------
hls-audio-aacl-125-Hindi  m3u8 audio only     |                  m3u8  | audio only        unknown        [hi] Hindi
hls-audio-aacl-125-Tamil  m3u8 audio only     |                  m3u8  | audio only        unknown        [ta] Tamil
hls-audio-aacl-125-Telugu m3u8 audio only     |                  m3u8  | audio only        unknown        [te] Telugu
hls-audio-aacl-45-Hindi   m3u8 audio only     |                  m3u8  | audio only        unknown        [hi] Hindi
hls-audio-aacl-45-Tamil   m3u8 audio only     |                  m3u8  | audio only        unknown        [ta] Tamil
hls-audio-aacl-45-Telugu  m3u8 audio only     |                  m3u8  | audio only        unknown        [te] Telugu
hls-audio-aacl-61-Hindi   m3u8 audio only     |                  m3u8  | audio only        unknown        [hi] Hindi
hls-audio-aacl-61-Tamil   m3u8 audio only     |                  m3u8  | audio only        unknown        [ta] Tamil
hls-audio-aacl-61-Telugu  m3u8 audio only     |                  m3u8  | audio only        unknown        [te] Telugu
hls-audio-aacl-93-Hindi   m3u8 audio only     |                  m3u8  | audio only        unknown        [hi] Hindi
hls-audio-aacl-93-Tamil   m3u8 audio only     |                  m3u8  | audio only        unknown        [ta] Tamil
hls-audio-aacl-93-Telugu  m3u8 audio only     |                  m3u8  | audio only        unknown        [te] Telugu
hls-155                   mp4  320x180     25 | ~ 23.00MiB  155k m3u8  | avc1.64000C  100k mp4a.40.2  45k
hls-278                   mp4  480x270     25 | ~ 41.26MiB  278k m3u8  | avc1.640015  200k mp4a.40.2  61k
hls-523                   mp4  480x270     25 | ~ 77.62MiB  523k m3u8  | avc1.640015  400k mp4a.40.2  93k
hls-769                   mp4  640x360     25 | ~114.13MiB  769k m3u8  | avc1.64001E  600k mp4a.40.2 125k
hls-981                   mp4  854x480     25 | ~145.60MiB  981k m3u8  | avc1.64001E  800k mp4a.40.2 125k
hls-1405                  mp4  1280x720    25 | ~208.52MiB 1405k m3u8  | avc1.64001F 1200k mp4a.40.2 125k
hls-2571                  mp4  1920x1080   25 | ~381.58MiB 2571k m3u8  | avc1.640028 2300k mp4a.40.2 125k 

Provide verbose output that clearly demonstrates the problem

  • Run your yt-dlp command with -vU flag added (yt-dlp -vU <your command line>)
  • If using API, add 'verbose': True to YoutubeDL params instead
  • Copy the WHOLE output (starting with [debug] Command-line config) and insert it below

Complete Verbose Output

[debug] Command-line config: ['-vU', '-u', 'PRIVATE', '-p', 'PRIVATE', '-F', '--audio-multistreams', 'https://www.jiocinema.com/tv-shows/pokemon/3/the-fortune-hunters/3776882']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp [12b248ce6] (pip)
[debug] Python 3.10.4 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 1.1.1n  15 Mar 2022)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.06.02, mutagen-1.47.0, requests-2.32.3, sqlite3-3.37.2, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1820 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp)
[jiocinema] To extend the life of your login session, in addition to your access token, you can pass --extractor-args "jiocinema:refresh_token=REFRESH_TOKEN" where REFRESH_TOKEN is the `refreshToken` UUID from your browser local storage
[debug] Loading jiocinema.xxx-xxx-xxx-xxx-xxx-refresh from cache
[debug] Saving jiocinema.xxx-xxx-xxx-xxx-xxx-access to cache
[jiocinema] Logging in as device ID "xxx-xxx-xxx-xxx-xxx"
[jiocinema] Refreshing token
[debug] Saving jiocinema.xxx-xxx-xxx-xxx-xxx-access to cache
[jiocinema] Extracting URL: https://www.jiocinema.com/tv-shows/pokemon/3/the-fortune-hunters/3776882
[jiocinema] 3776882: Downloading playback JSON
[jiocinema] 3776882: Downloading JSON metadata
[jiocinema] 3776882: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 3776882:
ID                         EXT  RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC     MORE INFO
───────────────────────────────────────────────────────────────────────────────────────────────────────────────────
hls-audio-aacl-125-English m3u8 audio only     │                  m3u8  │ audio only        unknown    [en] English
hls-audio-aacl-45-English  m3u8 audio only     │                  m3u8  │ audio only        unknown    [en] English
hls-audio-aacl-61-English  m3u8 audio only     │                  m3u8  │ audio only        unknown    [en] English
hls-audio-aacl-93-English  m3u8 audio only     │                  m3u8  │ audio only        unknown    [en] English
hls-261                    mp4  480x270     25 │ ~ 39.48MiB  261k m3u8  │ avc1.4D4015  200k video only
hls-490                    mp4  480x270     25 │ ~ 74.13MiB  490k m3u8  │ avc1.4D4015  400k video only
hls-735                    mp4  640x360     25 │ ~111.19MiB  735k m3u8  │ avc1.4D401E  600k video only
hls-981                    mp4  854x480     25 │ ~148.40MiB  981k m3u8  │ avc1.4D401E  800k video only
hls-1405                   mp4  1280x720    25 │ ~212.54MiB 1405k m3u8  │ avc1.64001F 1200k video only
hls-2571                   mp4  1920x1080   25 │ ~388.93MiB 2571k m3u8  │ avc1.640028 2300k video only
@varunchopra varunchopra added site-bug Issue with a specific website triage Untriaged issue labels Jun 9, 2024
@bashonly
Copy link
Member

bashonly commented Jun 9, 2024

At the time I wrote the extractor code, all of the DASH formats were DRM-protected.

@bashonly bashonly added account-needed Account details are needed to test/fix this geo-blocked Content is geo-blocked can-share-account Someone is willing to provide account details for development labels Jun 9, 2024
@varunchopra
Copy link
Author

varunchopra commented Jun 9, 2024

Ah, I see. That makes sense.

I picked a movie from the homepage at random, and it seems to be the same case here:
https://www.jiocinema.com/movies/vicky-donor/3489693/watch

The movie loads without DRM, although I see the warning on Firefox asking me to enable it. When using yt-dlp, it shows no streams:

ERROR: [jiocinema] 3489693: No video formats found! Please report this issue at https://github.com/yt-dlp/yt-dlp/issues?q=, filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U.

I see you've added the account-needed and can-share-account tags, so let me know the process. I can share my account or help with code if it's a straightforward change (though I haven't worked with DASH or yt-dl before).

@bashonly
Copy link
Member

bashonly commented Jun 9, 2024

When using yt-dlp, it shows no streams:

Can you show the full verbose log? The extractor should be detecting this and raising as DRM protected

@varunchopra
Copy link
Author

Yeah, here you go...

[debug] Command-line config: ['-vU', '-u', 'PRIVATE', '-p', 'PRIVATE', '-F', '--audio-multistreams', 'https://www.jiocinema.com/movies/welcome-back/3486540/watch']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp [12b248ce6] (pip)
[debug] Python 3.10.4 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 1.1.1n  15 Mar 2022)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.06.02, mutagen-1.47.0, requests-2.32.3, sqlite3-3.37.2, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1820 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp)
[jiocinema] To extend the life of your login session, in addition to your access token, you can pass --extractor-args "jiocinema:refresh_token=REFRESH_TOKEN" where REFRESH_TOKEN is the `refreshToken` UUID from your browser local storage
[debug] Loading jiocinema.xxxx-xxxx-xxxx-xxxx-refresh from cache
[debug] Saving jiocinema.xxxx-xxxx-xxxx-xxxx-access to cache
[jiocinema] Logging in as device ID "xxxx-xxxx-xxxx-xxxx"
[jiocinema] Refreshing token
[debug] Saving jiocinema.xxxx-xxxx-xxxx-xxxx-access to cache
[jiocinema] Extracting URL: https://www.jiocinema.com/movies/welcome-back/3486540/watch
[jiocinema] 3486540: Downloading playback JSON
[jiocinema] 3486540: Downloading JSON metadata
[jiocinema] 3486540: Downloading m3u8 information
ERROR: [jiocinema] 3486540: No video formats found!; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
Traceback (most recent call last):
  File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1606, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1762, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
  File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1821, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
  File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 2825, in process_video_result
    self.raise_no_formats(info_dict)
  File "C:\Users\Username\AppData\Local\Programs\Python\Python310\lib\site-packages\yt_dlp\YoutubeDL.py", line 1104, in raise_no_formats
    raise ExtractorError(msg, video_id=info['id'], ie=info['extractor'],
yt_dlp.utils.ExtractorError: [jiocinema] 3486540: No video formats found!; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U

I added a log line to the DRM check:

if not m3u8_url:  # DRM-only content only serves dash urls
    self.report_drm(video_id)
else:
    import logging
    logging.error(m3u8_url)

It's finding this m3u8 stream:

https://jc-ak-hlsstreaming.jiocinema.com/vod/_definst_/smil:vod/86/88/35270cc15ba211e683998d4b97bd9d9a_audio_1678974045226.smil/playlist_voot_web_premium.m3u8?hdnts=st=1717953433~exp=1717954033~acl=/vod/_definst_/smil:vod/86/88/35270cc15ba211e683998d4b97bd9d9a_audio_1678974045226.smil/*~id=00766a32e154458f8f04ff611ffe5e4e~hmac=ca1c1e0e0d3bf536edece89c4ef10c2f00b67a1da8c5462a78f5c48e0ca837b0

@bashonly
Copy link
Member

bashonly commented Jun 9, 2024

Ah so it has an m3u8 url but it's only subs. Gotta adjust for that

Hmm actually there are formats available, but the manifest just doesn't give resolutions for its variants, so our filter removes them

@bashonly
Copy link
Member

bashonly commented Jun 9, 2024

I think this would work for the no-formats issue:

diff --git a/yt_dlp/extractor/jiocinema.py b/yt_dlp/extractor/jiocinema.py
index e7186d75c..b52987f5d 100644
--- a/yt_dlp/extractor/jiocinema.py
+++ b/yt_dlp/extractor/jiocinema.py
@@ -242,9 +242,11 @@ def _extract_formats_and_subtitles(self, playback, video_id):
         self._remove_duplicate_formats(formats)
 
         return {
-            # '/_definst_/smil:vod/' m3u8 manifests claim to have 720p+ formats but max out at 480p
+            # '/_definst_/smil:vod/' m3u8 manifests need special handling:
+            # - they claim to have 720p+ formats but max out at 480p
+            # - some don't provide resolution info for their variants
             'formats': traverse_obj(formats, (
-                lambda _, v: '/_definst_/smil:vod/' not in v['url'] or v['height'] <= 480)),
+                lambda _, v: '/_definst_/smil:vod/' not in v['url'] or not v.get('height') or v['height'] <= 480)),
             'subtitles': subtitles,
         }
 

@varunchopra
Copy link
Author

Yep, that did the trick!

[debug] Command-line config: ['-vU', '-u', 'PRIVATE', '-p', 'PRIVATE', '-F', '--audio-multistreams', 'https://www.jiocinema.com/movies/welcome-back/3486540/watch']
[debug] Encodings: locale cp1252, fs utf-8, pref cp1252, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version [email protected] from yt-dlp/yt-dlp [12b248ce6] (pip)
[debug] Python 3.10.4 (CPython AMD64 64bit) - Windows-10-10.0.22621-SP0 (OpenSSL 1.1.1n  15 Mar 2022)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.06.02, mutagen-1.47.0, requests-2.32.3, sqlite3-3.37.2, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1820 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: [email protected] from yt-dlp/yt-dlp
yt-dlp is up to date ([email protected] from yt-dlp/yt-dlp)
[jiocinema] To extend the life of your login session, in addition to your access token, you can pass --extractor-args "jiocinema:refresh_token=REFRESH_TOKEN" where REFRESH_TOKEN is the `refreshToken` UUID from your browser local storage
[debug] Loading jiocinema.xxxx-xxxx-xxxx-xxxx-xxxx-refresh from cache
[debug] Saving jiocinema.xxxx-xxxx-xxxx-xxxx-xxxx-access to cache
[jiocinema] Logging in as device ID "xxxx-xxxx-xxxx-xxxx-xxxx"
[jiocinema] Refreshing token
[debug] Saving jiocinema.xxxx-xxxx-xxxx-xxxx-xxxx-access to cache
[jiocinema] Extracting URL: https://www.jiocinema.com/movies/welcome-back/3486540/watch
[jiocinema] 3486540: Downloading playback JSON
[jiocinema] 3486540: Downloading JSON metadata
[jiocinema] 3486540: Downloading m3u8 information
[debug] Formats sorted by: hasvid, ie_pref, lang, quality, res, fps, hdr:12(7), vcodec:vp9.2(10), channels, acodec, size, br, asr, proto, vext, aext, hasaud, source, id
[info] Available formats for 3486540:
ID       EXT RESOLUTION │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC       ABR
─────────────────────────────────────────────────────────────────────────────────────
hls-232  mp4 unknown    │ ~247.19MiB  232k m3u8  │ unknown -1717809k unknown 1718041k
hls-448  mp4 unknown    │ ~477.34MiB  448k m3u8  │ unknown -1717593k unknown 1718041k
hls-864  mp4 unknown    │ ~920.59MiB  864k m3u8  │ unknown -1717177k unknown 1718041k
hls-1328 mp4 unknown    │ ~  1.38GiB 1328k m3u8  │ unknown -1716713k unknown 1718041k
hls-1728 mp4 unknown    │ ~  1.80GiB 1728k m3u8  │ unknown -1716313k unknown 1718041k
hls-2428 mp4 unknown    │ ~  2.53GiB 2428k m3u8  │ unknown -1715613k unknown 1718041k

Do you need me to create a different issue for this? Or is it okay if I clump it with the original issue?

@bashonly
Copy link
Member

bashonly commented Jun 9, 2024

No need, I'll just open a PR in a bit. Thanks for testing the patch

@varunchopra
Copy link
Author

varunchopra commented Jun 9, 2024

On that note, I want to add something odd I've noticed...

hls-864  mp4 unknown    │ ~920.59MiB  864k m3u8  │ unknown -1717177k unknown 1718041k
hls-1328 mp4 unknown    │ ~  1.38GiB 1328k m3u8  │ unknown -1716713k unknown 1718041k
hls-1728 mp4 unknown    │ ~  1.80GiB 1728k m3u8  │ unknown -1716313k unknown 1718041k
hls-2428 mp4 unknown    │ ~  2.53GiB 2428k m3u8  │ unknown -1715613k unknown 1718041k

All of the above download the same video, and I can see the same potato video quality in my browser as well. media info

@bashonly
Copy link
Member

bashonly commented Jun 9, 2024

Figures. Have to fine-tune the filter a bit more then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
account-needed Account details are needed to test/fix this can-share-account Someone is willing to provide account details for development geo-blocked Content is geo-blocked site-bug Issue with a specific website triage Untriaged issue
Projects
None yet
Development

No branches or pull requests

2 participants