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

Banbye support for URL's containing a hyphen #7895

Closed
10 of 11 tasks
nicolaasjan opened this issue Aug 18, 2023 · 4 comments · Fixed by #8059
Closed
10 of 11 tasks

Banbye support for URL's containing a hyphen #7895

nicolaasjan opened this issue Aug 18, 2023 · 4 comments · Fixed by #8059
Labels
good first issue Good for new devs 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

@nicolaasjan
Copy link

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

The Netherlands

Provide a description that is worded well enough to be understood

Example:
https://banbye.com/watch/v_kb6_o1Kyq-CD
yt-dlp only takes the part preceding the -:
[BanBye] v_kb6_o1Kyq: Downloading JSON metadata

What does work, is copying the video URL via right-click and feed that to yt-dlp.
But then it saves as 480 [480].mp4...

yt-dlp -vU --ignore-config "https://vod.banbye.com:31005/video/v_kb6_o1Kyq-CD/480.mp4"
[debug] Command-line config: ['-vU', '--ignore-config', 'https://vod.banbye.com:31005/video/v_kb6_o1Kyq-CD/480.mp4']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2023.08.14.182926 [876b70c8e] (zip)
[debug] Python 3.8.10 (CPython x86_64 64bit) - Linux-5.4.0-156-generic-x86_64-with-glibc2.29 (OpenSSL 1.1.1f  31 Mar 2020, glibc 2.31)
[debug] exe versions: ffmpeg N-111711-gd295b6b693-Nico-20230808 (fdk,setts), ffprobe N-111711-gd295b6b693-Nico-20230808, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.46.0, secretstorage-3.3.3, sqlite3-2.6.0, websockets-11.0.3, xattr-0.9.6
[debug] Proxy map: {}
[debug] Loaded 1863 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Available version: nightly@2023.08.14.182926, Current version: nightly@2023.08.14.182926
Current Build Hash: d66b5383fd468d11b0400e423e6db8704cc0f5fcfd3db28e06d0e821ceb3a546
yt-dlp is up to date (nightly@2023.08.14.182926)
[generic] Extracting URL: https://vod.banbye.com:31005/video/v_kb6_o1Kyq-CD/480.mp4
[generic] 480: Downloading webpage
[debug] Identified a direct video link
[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] 480: Downloading 1 format(s): mp4
[debug] Invoking http downloader on "https://vod.banbye.com:31005/video/v_kb6_o1Kyq-CD/480.mp4"
[download] Destination: 480 [480].mp4
[download] 100% of   88.91MiB in 00:00:08 at 10.24MiB/s

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

yt-dlp -vU --ignore-config "https://banbye.com/watch/v_kb6_o1Kyq-CD"
[debug] Command-line config: ['-vU', '--ignore-config', 'https://banbye.com/watch/v_kb6_o1Kyq-CD']
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out utf-8, error utf-8, screen utf-8
[debug] yt-dlp version nightly@2023.08.14.182926 [876b70c8e] (zip)
[debug] Python 3.8.10 (CPython x86_64 64bit) - Linux-5.4.0-156-generic-x86_64-with-glibc2.29 (OpenSSL 1.1.1f  31 Mar 2020, glibc 2.31)
[debug] exe versions: ffmpeg N-111711-gd295b6b693-Nico-20230808 (fdk,setts), ffprobe N-111711-gd295b6b693-Nico-20230808, phantomjs 2.1.1, rtmpdump 2.4
[debug] Optional libraries: Cryptodome-3.18.0, brotli-1.0.9, certifi-2023.07.22, mutagen-1.46.0, secretstorage-3.3.3, sqlite3-2.6.0, websockets-11.0.3, xattr-0.9.6
[debug] Proxy map: {}
[debug] Loaded 1863 extractors
[debug] Fetching release info: https://api.github.com/repos/yt-dlp/yt-dlp-nightly-builds/releases/latest
Available version: nightly@2023.08.14.182926, Current version: nightly@2023.08.14.182926
Current Build Hash: d66b5383fd468d11b0400e423e6db8704cc0f5fcfd3db28e06d0e821ceb3a546
yt-dlp is up to date (nightly@2023.08.14.182926)
[BanBye] Extracting URL: https://banbye.com/watch/v_kb6_o1Kyq-CD
[BanBye] v_kb6_o1Kyq: Downloading JSON metadata
ERROR: [BanBye] v_kb6_o1Kyq: Unable to download JSON metadata: HTTP Error 404: Not Found (caused by <HTTPError 404: Not 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
  File "/usr/local/bin/yt-dlp/yt_dlp/extractor/common.py", line 715, in extract
    ie_result = self._real_extract(url)
  File "/usr/local/bin/yt-dlp/yt_dlp/extractor/banbye.py", line 72, in _real_extract
    data = self._download_json(f'{self._API_BASE}/videos/{video_id}', video_id)
  File "/usr/local/bin/yt-dlp/yt_dlp/extractor/common.py", line 1069, in download_content
    res = getattr(self, download_handle.__name__)(url_or_request, video_id, **kwargs)
  File "/usr/local/bin/yt-dlp/yt_dlp/extractor/common.py", line 1033, in download_handle
    res = self._download_webpage_handle(
  File "/usr/local/bin/yt-dlp/yt_dlp/extractor/common.py", line 903, 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 "/usr/local/bin/yt-dlp/yt_dlp/extractor/common.py", line 860, in _request_webpage
    raise ExtractorError(errmsg, cause=err)

  File "/usr/local/bin/yt-dlp/yt_dlp/networking/_urllib.py", line 438, in _send
    res = opener.open(urllib_req, timeout=float(request.extensions.get('timeout') or self.timeout))
  File "/usr/lib/python3.8/urllib/request.py", line 531, in open
    response = meth(req, response)
  File "/usr/lib/python3.8/urllib/request.py", line 640, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.8/urllib/request.py", line 569, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 502, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.8/urllib/request.py", line 649, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found

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

Traceback (most recent call last):
  File "/usr/local/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 4059, in urlopen
    return self._request_director.send(req)
  File "/usr/local/bin/yt-dlp/yt_dlp/networking/common.py", line 114, in send
    response = handler.send(request)
  File "/usr/local/bin/yt-dlp/yt_dlp/networking/_helper.py", line 203, in wrapper
    return func(self, *args, **kwargs)
  File "/usr/local/bin/yt-dlp/yt_dlp/networking/common.py", line 325, in send
    return self._send(request)
  File "/usr/local/bin/yt-dlp/yt_dlp/networking/_urllib.py", line 443, in _send
    raise HTTPError(UrllibResponseAdapter(e.fp), redirect_loop='redirect error' in str(e)) from e
yt_dlp.networking.exceptions.HTTPError: HTTP Error 404: Not Found

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

Traceback (most recent call last):
  File "/usr/local/bin/yt-dlp/yt_dlp/extractor/common.py", line 847, in _request_webpage
    return self._downloader.urlopen(self._create_request(url_or_request, data, headers, query))
  File "/usr/local/bin/yt-dlp/yt_dlp/YoutubeDL.py", line 4078, in urlopen
    raise _CompatHTTPError(e) from e
yt_dlp.networking.exceptions._CompatHTTPError: HTTP Error 404: Not Found
@nicolaasjan nicolaasjan added site-bug Issue with a specific website triage Untriaged issue labels Aug 18, 2023
@nicolaasjan nicolaasjan mentioned this issue Aug 18, 2023
7 tasks
@bashonly
Copy link
Member

Easy fix:

diff --git a/yt_dlp/extractor/banbye.py b/yt_dlp/extractor/banbye.py
index c87342565..fc70ecfce 100644
--- a/yt_dlp/extractor/banbye.py
+++ b/yt_dlp/extractor/banbye.py
@@ -31,7 +31,7 @@ def _extract_playlist(self, playlist_id):
 
 
 class BanByeIE(BanByeBaseIE):
-    _VALID_URL = r'https?://(?:www\.)?banbye.com/(?:en/)?watch/(?P<id>\w+)'
+    _VALID_URL = r'https?://(?:www\.)?banbye.com/(?:en/)?watch/(?P<id>[\w-]+)'
     _TESTS = [{
         'url': 'https://banbye.com/watch/v_ytfmvkVYLE8T',
         'md5': '2f4ea15c5ca259a73d909b2cfd558eb5',

Maybe this _VALID_URL change should be applied to BanByeChannelIE as well, but I don't use the site so I dunno

@bashonly bashonly added good first issue Good for new devs patch-available There is patch available that should fix this issue. Someone needs to make a PR with it and removed triage Untriaged issue labels Aug 18, 2023
@nicolaasjan
Copy link
Author

Maybe this _VALID_URL change should be applied to BanByeChannelIE as well, but I don't use the site so I dunno

No idea.
I don't use the site either, because I don't understand Polish. 😀️
It was an issue reported via a PM by a member of the MSFN forum, where my Py3.8 Windows XP yt-dlp build is discussed.

B.t.w., this is not my first issue. 😀️

@bashonly
Copy link
Member

B.t.w., this is not my first issue

Oh I know. The label is used to signify that this would be a good issue for someone who is new to yt-dlp development to work on

@nicolaasjan
Copy link
Author

The fix worked, even on XP, haha.

coletdjnz pushed a commit that referenced this issue Sep 16, 2023
aalsuwaidi pushed a commit to aalsuwaidi/yt-dlp that referenced this issue Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for new devs 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

Successfully merging a pull request may close this issue.

2 participants