Merge pull request #246 from pukkandan/bitchute-embed

Detect embedded bitchute videos
This commit is contained in:
Tom-Oliver Heidel 2020-11-30 02:25:38 +01:00 committato da GitHub
commit 284ec6f48a
Non sono state trovate chiavi note per questa firma nel database
ID Chiave GPG: 4AEE18F83AFDEB23
2 ha cambiato i file con 14 aggiunte e 0 eliminazioni

Vedi File

@ -36,6 +36,14 @@ class BitChuteIE(InfoExtractor):
'only_matching': True,
}]
@staticmethod
def _extract_urls(webpage):
return [
mobj.group('url')
for mobj in re.finditer(
r'<(?:script|iframe)[^>]+\bsrc=(["\'])(?P<url>%s)' % BitChuteIE._VALID_URL,
webpage)]
def _real_extract(self, url):
video_id = self._match_id(url)

Vedi File

@ -120,6 +120,7 @@ from .expressen import ExpressenIE
from .zype import ZypeIE
from .odnoklassniki import OdnoklassnikiIE
from .kinja import KinjaEmbedIE
from .bitchute import BitChuteIE
class GenericIE(InfoExtractor):
@ -3212,6 +3213,11 @@ class GenericIE(InfoExtractor):
return self.playlist_from_matches(
zype_urls, video_id, video_title, ie=ZypeIE.ie_key())
bitchute_urls = BitChuteIE._extract_urls(webpage)
if bitchute_urls:
return self.playlist_from_matches(
bitchute_urls, video_id, video_title, ie=BitChuteIE.ie_key())
# Look for HTML5 media
entries = self._parse_html5_media_entries(url, webpage, video_id, m3u8_id='hls')
if entries: