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

on.orf.at not complete DRM detection #9652

Closed
9 of 11 tasks
TuxCoder opened this issue Apr 8, 2024 · 1 comment
Closed
9 of 11 tasks

on.orf.at not complete DRM detection #9652

TuxCoder opened this issue Apr 8, 2024 · 1 comment
Labels
DRM The referred content is DRM protected patch-available There is patch available that should fix this issue. Someone needs to make a PR with it site-bug Issue with a specific website

Comments

@TuxCoder
Copy link
Contributor

TuxCoder commented Apr 8, 2024

DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

Checklist

  • I understand that I will be blocked if I intentionally remove or skip any mandatory* field
  • I'm reporting that yt-dlp is broken on a supported site
  • I've verified that I have updated yt-dlp to nightly or master (update instructions)
  • I've checked that all provided URLs are playable in a browser with the same IP and same login details
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched known issues and the bugtracker for similar issues including closed ones. DO NOT post duplicates
  • I've read the guidelines for opening an issue
  • I've read about sharing account credentials and I'm willing to share it if required

Region

Austria

Provide a description that is worded well enough to be understood

I found a video that is DRM Protected but the -F parameter reports available formats to download:
I added the --allow-unplayable-formats for better understanding, what is marked as DRM and what not.
All should be marked but some aren't
See Complete Verbose Output

all of them are DRM protected what can be found out by --check-formats

/tmp 3.9s [1] nix run -- nixpkgs#yt-dlp "https://on.orf.at/video/14217002/dsf" --check-formats -vU
[debug] Command-line config: ['https://on.orf.at/video/14217002/dsf', '--check-formats', '-vU']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.03.10 from yt-dlp/yt-dlp [615a84447] (pip)
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.1.77-x86_64-with-glibc2.38 (OpenSSL 3.0.13 30 Jan 2024, glibc 2.38)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.18.0, brotlicffi-1.1.0.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.43.2, urllib3-2.0.7, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1803 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.03.10 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.03.10 from yt-dlp/yt-dlp)
[orf:on] Extracting URL: https://on.orf.at/video/14217002/dsf
[orf:on] dsf: Downloading webpage
[orf:on] dsf: Downloading JSON metadata
[orf:on] dsf: Downloading m3u8 information
[orf:on] dsf: Downloading m3u8 information
[orf:on] dsf: Downloading MPD manifest
[orf:on] dsf: Downloading MPD manifest
[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
[debug] Default format spec: bestvideo*+bestaudio/best
[info] Testing format hls-3192-1
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-3192-1. Skipping...
[info] Testing format hls-3192-0
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-3192-0. Skipping...
[info] Testing format hls-1992-1
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-1992-1. Skipping...
[info] Testing format hls-1992-0
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-1992-0. Skipping...
[info] Testing format hls-992-1
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-992-1. Skipping...
[info] Testing format hls-992-0
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-992-0. Skipping...
[info] Testing format dash-p0aa0br192000-1
[dashsegments] Total fragments: 1
[download] Destination: /tmp/tmp973tt42o.tmp
[download] 100% of    651.00B in 00:00:00 at 9.21KiB/s
[info] Testing format hls-3192-1
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-3192-1. Skipping...
[info] Testing format hls-3192-0
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-3192-0. Skipping...
[info] Testing format hls-1992-1
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-1992-1. Skipping...
[info] Testing format hls-1992-0
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-1992-0. Skipping...
[info] Testing format hls-992-1
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-992-1. Skipping...
[info] Testing format hls-992-0
[hlsnative] Downloading m3u8 manifest
ERROR: This format is DRM protected; Try selecting another format with --format or add --check-formats to automatically fallback to the next best format

[info] Unable to download format hls-992-0. Skipping...
ERROR: [orf:on] 14217002: Requested format is not available. Use --list-formats for a list of available formats
Traceback (most recent call last):
  File "/nix/store/rmfvh66k2rr05djcqxx61v59wr569xmb-python3.11-yt-dlp-2024.3.10/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1594, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/rmfvh66k2rr05djcqxx61v59wr569xmb-python3.11-yt-dlp-2024.3.10/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1750, in __extract_info
    return self.process_ie_result(ie_result, download, extra_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/rmfvh66k2rr05djcqxx61v59wr569xmb-python3.11-yt-dlp-2024.3.10/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 1809, in process_ie_result
    ie_result = self.process_video_result(ie_result, download=download)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/rmfvh66k2rr05djcqxx61v59wr569xmb-python3.11-yt-dlp-2024.3.10/lib/python3.11/site-packages/yt_dlp/YoutubeDL.py", line 2930, in process_video_result
    raise ExtractorError(
yt_dlp.utils.ExtractorError: [orf:on] 14217002: Requested format is not available. Use --list-formats for a list of available formats

I created a openapi description for the new v4.3 api that can be found here:
https://gist.github.com/TuxCoder/6987f49e01d8ef826037cb99afdcc1b2
The interessting part is the public api
https://gist.github.com/TuxCoder/6987f49e01d8ef826037cb99afdcc1b2#file-openapiv3-yaml-L626
with the content of an Episode
https://gist.github.com/TuxCoder/6987f49e01d8ef826037cb99afdcc1b2#file-openapiv3-yaml-L813

there is a field calld is_drm_protected what should be reliable

Edit:
There is also the same field for each Source
https://gist.github.com/TuxCoder/6987f49e01d8ef826037cb99afdcc1b2#file-openapiv3-yaml-L674

The Json in question can be fetched here:
https://api-tvthek.orf.at/api/v4.3/public/episode/encrypted/M2RTbGZlazAzbnNMS2RqNEpzZDE0MjE3MDAy

EndEdit

I tested this with a small patch

diff --git a/yt_dlp/extractor/orf.py b/yt_dlp/extractor/orf.py
index 526e9acaf..4ff4cf90c 100644
--- a/yt_dlp/extractor/orf.py
+++ b/yt_dlp/extractor/orf.py
@@ -590,6 +590,9 @@ def _extract_video(self, video_id, display_id):
         api_json = self._download_json(
             f'https://api-tvthek.orf.at/api/v4.3/public/episode/encrypted/{encrypted_id}', display_id)
 
+
+        has_drm =  traverse_obj(api_json, 'is_drm_protected', {bool})
+
         formats, subtitles = [], {}
         for manifest_type in traverse_obj(api_json, ('sources', {dict.keys}, ...)):
             for manifest_url in traverse_obj(api_json, ('sources', manifest_type, ..., 'src', {url_or_none})):
@@ -601,6 +604,8 @@ def _extract_video(self, video_id, display_id):
                         manifest_url, display_id, fatal=False, mpd_id='dash')
                 else:
                     continue
+                for fmt in fmts:
+                    fmt['has_drm'] = has_drm
                 formats.extend(fmts)
                 self._merge_subtitles(subs, target=subtitles)

what looks like to fix the problem:
Now all are formats are shown as DRM protected

[~/projects/yt-dlp]$ python3 yt_dlp/__main__.py "https://on.orf.at/video/14217002/dsf" -F --allow-unplayable-formats -vU
[debug] Command-line config: ['https://on.orf.at/video/14217002/dsf', '-F', '--allow-unplayable-formats', '-vU']
WARNING: You have asked for UNPLAYABLE formats to be listed/downloaded. This is a developer option intended for debugging.
         If you experience any issues while using this option, DO NOT open a bug report
[debug] Encodings: locale utf-8, fs utf-8, pref utf-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.03.10 from yt-dlp/yt-dlp [615a84447] (source)
[debug] Lazy loading extractors is disabled
[debug] Git HEAD: 79a451e57
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.1.77-x86_64-with-glibc2.38 (OpenSSL 3.0.13 30 Jan 2024, glibc 2.38)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0
[debug] Optional libraries: Cryptodome-3.18.0, brotlicffi-1.1.0.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.43.2, urllib3-2.0.7, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1810 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.03.10 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.03.10 from yt-dlp/yt-dlp)
[orf:on] Extracting URL: https://on.orf.at/video/14217002/dsf
[orf:on] dsf: Downloading webpage
[orf:on] dsf: Downloading JSON metadata
[orf:on] dsf: Downloading m3u8 information
[orf:on] dsf: Downloading m3u8 information
[orf:on] dsf: Downloading MPD manifest
[orf:on] dsf: Downloading MPD manifest
[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 14217002:
ID                    EXT  RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC      ABR ASR MORE INFO
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
hls-audio-Deutsch-0   m3u8 audio only     │                  m3u8  │ audio only        unknown             [de] DRM, Deutsch
hls-audio-Deutsch-1   m3u8 audio only     │                  m3u8  │ audio only        unknown             [de] DRM, Deutsch
dash-p0aa0br192000-0  m4a  audio only     │ ~ 54.70MiB  192k dash  │ audio only        mp4a.40.2  192k 48k [de] DRM, DASH audio, m4a_dash
dash-p0aa0br192000-1  m4a  audio only     │ ~ 54.70MiB  192k dash  │ audio only        mp4a.40.2  192k 48k [de] DRM, DASH audio, m4a_dash
hls-992-0             mp4  640x360        │ ~282.63MiB  992k m3u8  │ unknown           unknown             DRM
hls-992-1             mp4  640x360        │ ~282.63MiB  992k m3u8  │ unknown           unknown             DRM
dash-p0va0br801596-0  mp4  640x360     25 │ ~228.38MiB  802k dash  │ avc1.64001e  802k video only          DRM, DASH video, mp4_dash
dash-p0va0br801596-1  mp4  640x360     25 │ ~228.38MiB  802k dash  │ avc1.64001e  802k video only          DRM, DASH video, mp4_dash
hls-1992-0            mp4  960x540        │ ~567.54MiB 1992k m3u8  │ unknown           unknown             DRM
hls-1992-1            mp4  960x540        │ ~567.54MiB 1992k m3u8  │ unknown           unknown             DRM
dash-p0va0br1801680-0 mp4  960x540     25 │ ~513.32MiB 1802k dash  │ avc1.64001f 1802k video only          DRM, DASH video, mp4_dash
dash-p0va0br1801680-1 mp4  960x540     25 │ ~513.32MiB 1802k dash  │ avc1.64001f 1802k video only          DRM, DASH video, mp4_dash
hls-3192-0            mp4  1280x720       │ ~909.43MiB 3192k m3u8  │ unknown           unknown             DRM
hls-3192-1            mp4  1280x720       │ ~909.43MiB 3192k m3u8  │ unknown           unknown             DRM
dash-p0va0br3001976-0 mp4  1280x720    25 │ ~855.29MiB 3002k dash  │ avc1.64001f 3002k video only          DRM, DASH video, mp4_dash
dash-p0va0br3001976-1 mp4  1280x720    25 │ ~855.29MiB 3002k dash  │ avc1.64001f 3002k video only          DRM, DASH video, mp4_dash

but I'm not sure its the right place

Also thanks to all Maintainer / Contributor, this is a awesome tool.

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

/tmp 1.6s ❱ nix run -- nixpkgs#yt-dlp "https://on.orf.at/video/14217002/dsf" --allow-unplayable-formats  -F -vU
[debug] Command-line config: ['https://on.orf.at/video/14217002/dsf', '--allow-unplayable-formats', '-F', '-vU']
WARNING: You have asked for UNPLAYABLE formats to be listed/downloaded. This is a developer option intended for debugging.
         If you experience any issues while using this option, DO NOT open a bug report
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version stable@2024.03.10 from yt-dlp/yt-dlp [615a84447] (pip)
[debug] Python 3.11.8 (CPython x86_64 64bit) - Linux-6.1.77-x86_64-with-glibc2.38 (OpenSSL 3.0.13 30 Jan 2024, glibc 2.38)
[debug] exe versions: ffmpeg 6.0 (setts), ffprobe 6.0, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.18.0, brotlicffi-1.1.0.0, certifi-2023.07.22, mutagen-1.47.0, requests-2.31.0, secretstorage-3.3.3, sqlite3-3.43.2, urllib3-2.0.7, websockets-11.0.3
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests
[debug] Loaded 1803 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest
Latest version: stable@2024.03.10 from yt-dlp/yt-dlp
yt-dlp is up to date (stable@2024.03.10 from yt-dlp/yt-dlp)
[orf:on] Extracting URL: https://on.orf.at/video/14217002/dsf
[orf:on] dsf: Downloading webpage
[orf:on] dsf: Downloading JSON metadata
[orf:on] dsf: Downloading m3u8 information
[orf:on] dsf: Downloading m3u8 information
[orf:on] dsf: Downloading MPD manifest
[orf:on] dsf: Downloading MPD manifest
[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 14217002:
ID                    EXT  RESOLUTION FPS │   FILESIZE   TBR PROTO │ VCODEC        VBR ACODEC      ABR ASR MORE INFO
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
hls-audio-Deutsch-0   m3u8 audio only     │                  m3u8  │ audio only        unknown             [de] Deutsch
hls-audio-Deutsch-1   m3u8 audio only     │                  m3u8  │ audio only        unknown             [de] Deutsch
dash-p0aa0br192000-0  m4a  audio only     │ ~ 56.02MiB  192k dash  │ audio only        mp4a.40.2  192k 48k [de] DASH audio, m4a_dash
dash-p0aa0br192000-1  m4a  audio only     │ ~ 56.02MiB  192k dash  │ audio only        mp4a.40.2  192k 48k [de] DASH audio, m4a_dash
hls-992-0             mp4  640x360        │ ~289.41MiB  992k m3u8  │ unknown           unknown
hls-992-1             mp4  640x360        │ ~289.41MiB  992k m3u8  │ unknown           unknown
dash-p0va0br801596-0  mp4  640x360     25 │ ~233.86MiB  802k dash  │ avc1.64001e  802k video only          DRM, DASH video, mp4_dash
dash-p0va0br801596-1  mp4  640x360     25 │ ~233.86MiB  802k dash  │ avc1.64001e  802k video only          DRM, DASH video, mp4_dash
hls-1992-0            mp4  960x540        │ ~581.16MiB 1992k m3u8  │ unknown           unknown
hls-1992-1            mp4  960x540        │ ~581.16MiB 1992k m3u8  │ unknown           unknown
dash-p0va0br1801680-0 mp4  960x540     25 │ ~525.64MiB 1802k dash  │ avc1.64001f 1802k video only          DRM, DASH video, mp4_dash
dash-p0va0br1801680-1 mp4  960x540     25 │ ~525.64MiB 1802k dash  │ avc1.64001f 1802k video only          DRM, DASH video, mp4_dash
hls-3192-0            mp4  1280x720       │ ~931.26MiB 3192k m3u8  │ unknown           unknown
hls-3192-1            mp4  1280x720       │ ~931.26MiB 3192k m3u8  │ unknown           unknown
dash-p0va0br3001976-0 mp4  1280x720    25 │ ~875.82MiB 3002k dash  │ avc1.64001f 3002k video only          DRM, DASH video, mp4_dash
dash-p0va0br3001976-1 mp4  1280x720    25 │ ~875.82MiB 3002k dash  │ avc1.64001f 3002k video only          DRM, DASH video, mp4_dash
@TuxCoder TuxCoder added site-bug Issue with a specific website triage Untriaged issue labels Apr 8, 2024
@TuxCoder TuxCoder changed the title on.orf.at not complete DRM detecten on.orf.at not complete DRM detection Apr 8, 2024
@bashonly
Copy link
Member

bashonly commented Apr 9, 2024

since it's an all-or-none situation, I'd just do this

diff --git a/yt_dlp/extractor/orf.py b/yt_dlp/extractor/orf.py
index 526e9acaf..63bc2625c 100644
--- a/yt_dlp/extractor/orf.py
+++ b/yt_dlp/extractor/orf.py
@@ -590,6 +590,9 @@ def _extract_video(self, video_id, display_id):
         api_json = self._download_json(
             f'https://api-tvthek.orf.at/api/v4.3/public/episode/encrypted/{encrypted_id}', display_id)
 
+        if traverse_obj(api_json, 'is_drm_protected'):
+            self.report_drm(video_id)
+
         formats, subtitles = [], {}
         for manifest_type in traverse_obj(api_json, ('sources', {dict.keys}, ...)):
             for manifest_url in traverse_obj(api_json, ('sources', manifest_type, ..., 'src', {url_or_none})):

@bashonly bashonly added patch-available There is patch available that should fix this issue. Someone needs to make a PR with it DRM The referred content is DRM protected and removed triage Untriaged issue labels Apr 9, 2024
TuxCoder pushed a commit to TuxCoder/yt-dlp that referenced this issue Apr 12, 2024
some videos formats are not reported as DRM protected
fixes: yt-dlp#9652
TuxCoder pushed a commit to TuxCoder/yt-dlp that referenced this issue Apr 12, 2024
some videos formats are not reported as DRM protected
fixes: yt-dlp#9652
TuxCoder pushed a commit to TuxCoder/yt-dlp that referenced this issue Apr 12, 2024
some videos formats are not reported as DRM protected
fixes: yt-dlp#9652
TuxCoder pushed a commit to TuxCoder/yt-dlp that referenced this issue Apr 12, 2024
some videos formats are not reported as DRM protected
fixes: yt-dlp#9652
TuxCoder pushed a commit to TuxCoder/yt-dlp that referenced this issue May 20, 2024
some videos formats were not reported as DRM protected
fixes: yt-dlp#9652
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DRM The referred content is DRM protected patch-available There is patch available that should fix this issue. Someone needs to make a PR with it site-bug Issue with a specific website
Projects
None yet
Development

No branches or pull requests

2 participants