Repository: yt-dlp/yt-dlp

Issue:
Banbye support for URL's containing a hyphen
### DO NOT REMOVE OR SKIP THE ISSUE TEMPLATE

- [X] I understand that I will be **blocked** if I *intentionally* remove or skip any mandatory\* field

### Checklist

- [X] I'm reporting that yt-dlp is broken on a **supported** site
- [X] I've verified that I'm running yt-dlp version **2023.07.06** ([update instructions](https://github.com/yt-dlp/yt-dlp#update)) or later (specify commit)
- [X] I've checked that all provided URLs are playable in a browser with the same IP and same login details
- [X] I've checked that all URLs and arguments with special characters are [properly quoted or escaped](https://github.com/yt-dlp/yt-dlp/wiki/FAQ#video-url-contains-an-ampersand--and-im-getting-some-strange-output-1-2839-or-v-is-not-recognized-as-an-internal-or-external-command)
- [X] I've searched [known issues](https://github.com/yt-dlp/yt-dlp/issues/3766) and the [bugtracker](https://github.com/yt-dlp/yt-dlp/issues?q=) for similar issues **including closed ones**. DO NOT post duplicates
- [X] I've read the [guidelines for opening an issue](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#opening-an-issue)
- [X] I've read about [sharing account credentials](https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#are-you-willing-to-share-account-details-if-needed) and I'm willing to share it if required

### 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`...

```shell
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

- [X] 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
- [X] Copy the WHOLE output (starting with `[debug] Command-line config`) and insert it below

### Complete Verbose Output

```shell
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
```
```



Discussion:
Easy fix:
```diff
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
> 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`. 😀️
> 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
The fix worked, even on XP, haha.

Resolving patch:
diff --git a/yt_dlp/extractor/banbye.py b/yt_dlp/extractor/banbye.py
--- 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',
@@ -59,7 +59,27 @@ class BanByeIE(BanByeBaseIE):
             'title': 'Krzysztof Karoń',
             'id': 'p_Ld82N6gBw_OJ',
         },
-        'playlist_count': 9,
+        'playlist_mincount': 9,
+    }, {
+        'url': 'https://banbye.com/watch/v_kb6_o1Kyq-CD',
+        'info_dict': {
+            'id': 'v_kb6_o1Kyq-CD',
+            'ext': 'mp4',
+            'title': 'Co tak naprawdę dzieje się we Francji?! Czy Warszawa a potem cała Polska będzie drugim Paryżem?!🤔🇵🇱',
+            'description': 'md5:82be4c0e13eae8ea1ca8b9f2e07226a8',
+            'uploader': 'Marcin Rola - MOIM ZDANIEM!🇵🇱',
+            'channel_id': 'ch_QgWnHvDG2fo5',
+            'channel_url': 'https://banbye.com/channel/ch_QgWnHvDG2fo5',
+            'duration': 597,
+            'timestamp': 1688642656,
+            'upload_date': '20230706',
+            'thumbnail': 'https://cdn.banbye.com/video/v_kb6_o1Kyq-CD/96.webp',
+            'tags': ['Paryż', 'Francja', 'Polska', 'Imigranci', 'Morawiecki', 'Tusk'],
+            'like_count': int,
+            'dislike_count': int,
+            'view_count': int,
+            'comment_count': int,
+        },
     }]
 
     def _real_extract(self, url):


Test patch: