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

Support ARD Mediathek URLs with "serien" (fixes #7666) #8687

Merged
merged 2 commits into from
Dec 24, 2023

Conversation

lstrojny
Copy link
Contributor

IMPORTANT: PRs without the template will be CLOSED

Description of your pull request and other information

Adds support for the following URL scheme: https://www.ardmediathek.de/serie/…, e.g. https://www.ardmediathek.de/serie/nachtstreife/staffel-1/Y3JpZDovL3N3ci5kZS9zZGIvc3RJZC8xMjQy/1

Fixes #7666

Template

Before submitting a pull request make sure you have:

In order to be accepted and merged into yt-dlp each piece of code must be in public domain or released under Unlicense. Check all of the following options that apply:

  • I am the original author of this code and I am willing to release it under Unlicense
  • I am not the original author of this code but it is in public domain or released under Unlicense (provide reliable evidence)

What is the purpose of your pull request?

@lstrojny lstrojny changed the title Support for URLs with serien (fixes #7666) Support ARD Mediathek URLs with "serien" (fixes #7666) Nov 30, 2023
yt_dlp/extractor/ard.py Outdated Show resolved Hide resolved
Co-authored-by: Simon Sawicki <accounts@grub4k.xyz>
@seproDev seproDev added the site-bug Issue with a specific website label Dec 2, 2023
@bashonly bashonly self-requested a review December 6, 2023 18:51
@marcusmueller
Copy link

Sadly, can't get this PR to work for the series landing page of Parlament Staffel 1 nor an individual video from there.

(after setting up virtualenv)

gh repo clone https://github.com/yt-dlp/yt-dlp
cd yt-dlp
gh pr checkout 8687 
pip install .
~/src/yt-dlp/yt-dlp.sh -v  https://www.ardmediathek.de/serie/parlament/staffel-1/Y3JpZDovL3dkci5kZS9vbmUvcGFybGFtZW50bmV1/1

yields

[debug] Command-line config: ['-v', 'https://www.ardmediathek.de/serie/parlament/staffel-1/Y3JpZDovL3dkci5kZS9vbmUvcGFybGFtZW50bmV1/1']
[debug] Command-line config: ['-v', 'https://www.ardmediathek.de/serie/parlament/staffel-1/Y3JpZDovL3dkci5kZS9vbmUvcGFybGFtZW50bmV1/1']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8 (No ANSI), screen utf-8
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8 (No ANSI), screen utf-8
[debug] yt-dlp version stable@2023.11.16 from yt-dlp/yt-dlp [24f827875] (source)
[debug] yt-dlp version stable@2023.11.16 from yt-dlp/yt-dlp [24f827875] (source)
[debug] Lazy loading extractors is disabled
[debug] Lazy loading extractors is disabled
[debug] Git HEAD: de4dc13b1
[debug] Git HEAD: de4dc13b1
[debug] Python 3.11.6 (CPython x86_64 64bit) - Linux-6.6.4-100.fc38.x86_64-x86_64-with-glibc2.37 (OpenSSL 3.0.9 30 May 2023, glibc 2.37)
[debug] Python 3.11.6 (CPython x86_64 64bit) - Linux-6.6.4-100.fc38.x86_64-x86_64-with-glibc2.37 (OpenSSL 3.0.9 30 May 2023, glibc 2.37)
[debug] exe versions: ffmpeg 6.0.1 (setts), ffprobe 6.0.1, rtmpdump 2.4
[debug] exe versions: ffmpeg 6.0.1 (setts), ffprobe 6.0.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.11.17, mutagen-1.47.0, requests-2.31.0, sqlite3-3.40.1, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Optional libraries: Cryptodome-3.19.0, brotli-1.1.0, certifi-2023.11.17, mutagen-1.47.0, requests-2.31.0, sqlite3-3.40.1, urllib3-2.1.0, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1792 extractors
[debug] Loaded 1792 extractors
[debug] Using fake IP 53.45.61.213 (DE) as X-Forwarded-For
[debug] Using fake IP 53.45.61.213 (DE) as X-Forwarded-For
ERROR: [ARDBetaMediathek] Y3JpZDovL3dkci5kZS9vbmUvcGFybGFtZW50bmV1: Unable to download JSON metadata: HTTP Error 503: Service Unavailable (caused by <HTTPError 503: Service Unavailable>); 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
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 717, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/ard.py", line 597, in _real_extract
    return self._ARD_extract_playlist(url, video_id, display_id, client, playlist_type)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/ard.py", line 558, in _ARD_extract_playlist
    show_page = self._ARD_load_playlist_snippet(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/ard.py", line 539, in _ARD_load_playlist_snippet
    show_page = self._download_json(
                ^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 1071, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 1035, in download_handle
    res = self._download_webpage_handle(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 905, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 862, in _request_webpage
    raise ExtractorError(errmsg, cause=err)

  File "/media/stripedvolume/src/yt-dlp/yt_dlp/YoutubeDL.py", line 4058, in urlopen
    return self._request_director.send(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/networking/common.py", line 114, in send
    response = handler.send(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/networking/_helper.py", line 204, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/networking/common.py", line 325, in send
    return self._send(request)
           ^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/networking/_requests.py", line 341, in _send
    raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 503: Service Unavailable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 849, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/YoutubeDL.py", line 4090, in urlopen
    raise _CompatHTTPError(e) from e
yt_dlp.networking.exceptions._CompatHTTPError: HTTP Error 503: Service Unavailable

ERROR: [ARDBetaMediathek] Y3JpZDovL3dkci5kZS9vbmUvcGFybGFtZW50bmV1: Unable to download JSON metadata: HTTP Error 503: Service Unavailable (caused by <HTTPError 503: Service Unavailable>); 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
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 717, in extract
    ie_result = self._real_extract(url)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/ard.py", line 597, in _real_extract
    return self._ARD_extract_playlist(url, video_id, display_id, client, playlist_type)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/ard.py", line 558, in _ARD_extract_playlist
    show_page = self._ARD_load_playlist_snippet(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/ard.py", line 539, in _ARD_load_playlist_snippet
    show_page = self._download_json(
                ^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 1071, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 1035, in download_handle
    res = self._download_webpage_handle(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 905, in _download_webpage_handle
    urlh = self._request_webpage(url_or_request, video_id, note, errnote, fatal, data=data, headers=headers, query=query, expected_status=expected_status)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 862, in _request_webpage
    raise ExtractorError(errmsg, cause=err)

  File "/media/stripedvolume/src/yt-dlp/yt_dlp/YoutubeDL.py", line 4058, in urlopen
    return self._request_director.send(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/networking/common.py", line 114, in send
    response = handler.send(request)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/networking/_helper.py", line 204, in wrapper
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/networking/common.py", line 325, in send
    return self._send(request)
           ^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/networking/_requests.py", line 341, in _send
    raise HTTPError(res, redirect_loop=max_redirects_exceeded)
yt_dlp.networking.exceptions.HTTPError: HTTP Error 503: Service Unavailable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/extractor/common.py", line 849, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/media/stripedvolume/src/yt-dlp/yt_dlp/YoutubeDL.py", line 4090, in urlopen
    raise _CompatHTTPError(e) from e
yt_dlp.networking.exceptions._CompatHTTPError: HTTP Error 503: Service Unavailable

@andreygursky
Copy link

ERROR: [ARDBetaMediathek] Y3JpZDovL3dkci5kZS9vbmUvcGFybGFtZW50bmV1: Unable to download JSON metadata: HTTP Error 503: Service Unavailable (caused by <HTTPError 503: Service Unavailable>); ...

@marcusmueller it's a different general issue. See #8731.

@seproDev seproDev added the pending-review PR needs a review label Dec 23, 2023
@bashonly bashonly removed the pending-review PR needs a review label Dec 24, 2023
@seproDev seproDev merged commit 1f8bd8e into yt-dlp:master Dec 24, 2023
14 of 15 checks passed
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this pull request Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
site-bug Issue with a specific website
Projects
None yet
6 participants