aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsepro <4618135+seproDev@users.noreply.github.com>2024-06-29 17:32:41 +0200
committerGitHub <noreply@github.com>2024-06-29 17:32:41 +0200
commit5b1a2aa978d0074cee278e7659f32f52ecc4ab53 (patch)
tree36425afa1c02045fd1b4b9ae6a533ea0e1d2100a
parent7814c50948a2b9a4c746441ecbc509ae563d5d1f (diff)
[ie/bitchute] Fix extractors (#10301)
Closes #10293 Authored by: seproDev
-rw-r--r--yt_dlp/extractor/bitchute.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/yt_dlp/extractor/bitchute.py b/yt_dlp/extractor/bitchute.py
index c74f34c2a..c83222ea5 100644
--- a/yt_dlp/extractor/bitchute.py
+++ b/yt_dlp/extractor/bitchute.py
@@ -24,7 +24,7 @@ from ..utils import (
class BitChuteIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?bitchute\.com/(?:video|embed|torrent/[^/]+)/(?P<id>[^/?#&]+)'
+ _VALID_URL = r'https?://(?:(?:www|old)\.)?bitchute\.com/(?:video|embed|torrent/[^/]+)/(?P<id>[^/?#&]+)'
_EMBED_REGEX = [rf'<(?:script|iframe)[^>]+\bsrc=(["\'])(?P<url>{_VALID_URL})']
_TESTS = [{
'url': 'https://www.bitchute.com/video/UGlrF9o9b-Q/',
@@ -91,6 +91,9 @@ class BitChuteIE(InfoExtractor):
}, {
'url': 'https://www.bitchute.com/torrent/Zee5BE49045h/szoMrox2JEI.webtorrent',
'only_matching': True,
+ }, {
+ 'url': 'https://old.bitchute.com/video/UGlrF9o9b-Q/',
+ 'only_matching': True,
}]
_GEO_BYPASS = False
@@ -132,7 +135,7 @@ class BitChuteIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(
- f'https://www.bitchute.com/video/{video_id}', video_id, headers=self._HEADERS)
+ f'https://old.bitchute.com/video/{video_id}', video_id, headers=self._HEADERS)
self._raise_if_restricted(webpage)
publish_date = clean_html(get_element_by_class('video-publish-date', webpage))
@@ -171,13 +174,13 @@ class BitChuteIE(InfoExtractor):
class BitChuteChannelIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?bitchute\.com/(?P<type>channel|playlist)/(?P<id>[^/?#&]+)'
+ _VALID_URL = r'https?://(?:(?:www|old)\.)?bitchute\.com/(?P<type>channel|playlist)/(?P<id>[^/?#&]+)'
_TESTS = [{
'url': 'https://www.bitchute.com/channel/bitchute/',
'info_dict': {
'id': 'bitchute',
'title': 'BitChute',
- 'description': 'md5:5329fb3866125afa9446835594a9b138',
+ 'description': 'md5:2134c37d64fc3a4846787c402956adac',
},
'playlist': [
{
@@ -210,6 +213,9 @@ class BitChuteChannelIE(InfoExtractor):
'title': 'Bruce MacDonald and "The Light of Darkness"',
'description': 'md5:747724ef404eebdfc04277714f81863e',
},
+ }, {
+ 'url': 'https://old.bitchute.com/playlist/wV9Imujxasw9/',
+ 'only_matching': True,
}]
_TOKEN = 'zyG6tQcGPE5swyAEFLqKUwMuMMuF6IO2DZ6ZDQjGfsL0e4dcTLwqkTTul05Jdve7'
@@ -230,7 +236,7 @@ class BitChuteChannelIE(InfoExtractor):
@staticmethod
def _make_url(playlist_id, playlist_type):
- return f'https://www.bitchute.com/{playlist_type}/{playlist_id}/'
+ return f'https://old.bitchute.com/{playlist_type}/{playlist_id}/'
def _fetch_page(self, playlist_id, playlist_type, page_num):
playlist_url = self._make_url(playlist_id, playlist_type)