before_code stringlengths 14 465k | reviewer_comment stringlengths 16 64.5k | after_code stringlengths 9 467k | diff_context stringlengths 0 97k | file_path stringlengths 5 226 | comment_line int32 0 26 | language stringclasses 37
values | quality_score float32 0.07 1 | comment_type stringclasses 9
values | comment_length int32 16 64.5k | before_lines int32 1 17.2k | after_lines int32 1 12.1k | is_negative bool 2
classes | pr_title stringlengths 1 308 | pr_number int32 1 299k | repo_name stringclasses 533
values | repo_stars int64 321 419k | repo_language stringclasses 27
values | reviewer_username stringlengths 0 39 | author_username stringlengths 2 39 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
import calendar
import datetime
from .common import InfoExtractor
from ..utils import (
ExtractorError,
UserNotLive,
traverse_obj,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス). Only works for the link starts with "live.eplus.jp/ex/player?ib="'
_VALID_URL =... | ```suggestion
IE_DESC = 'e+ (イープラス)'
``` | from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)'
_TESTS = ... | @@ -0,0 +1,85 @@
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ UserNotLive,
+ traverse_obj,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス). Only works for the link starts with "live.eplus.jp/e... | yt_dlp/extractor/eplus.py | 14 | Python | 0.429 | suggestion | 46 | 39 | 39 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pzhlkj6612 |
# complex fake url
'url': 'https://live.eplus.jp/ex/player?ib=YA4Z%2Fz2rpI5cDl3V%2Bx9PI%2FXTGOX0j8IBzPthgx7%2BieWeff6iLcdsdsds1926zosZU9AbB3gdL3wG%2BNa1afQdIf%3D%3D',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._d... | ```suggestion
if archive_mode == 'ON':
``` | 'description': str,
},
'params': {
'skip_download': True,
'ignore_no_formats_error': True,
},
'expected_warnings': [
'Could not find the playlist URL. This event may not be accessible',
'No video formats found!',
'Re... | @@ -0,0 +1,76 @@
+import calendar
+import datetime
+
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ UserNotLive,
+ traverse_obj,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス)'
+ _VALID_URL = r'https?://live\.eplus\.jp/ex/play... | yt_dlp/extractor/eplus.py | 26 | Python | 0.571 | suggestion | 56 | 51 | 51 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pzhlkj6612 |
import calendar
import datetime
from .common import InfoExtractor
from ..utils import (
ExtractorError,
UserNotLive,
traverse_obj,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス)'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>([A-Za-z\d]|%2B|%2... | Well, the eplus player links for local and overseas users may be different. I'm not able to buy tickets as a local, so this extractor, now, is only for extracting info from inbound (ib) links.
Local users will not use this extractor if they see that description, so I think it's better to keep the previous text here.... | from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)'
_TESTS = ... | @@ -11,7 +11,7 @@
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
- IE_DESC = 'e+ (イープラス). Only works for the link starts with "live.eplus.jp/ex/player?ib="'
+ IE_DESC = 'e+ (イープラス)' | yt_dlp/extractor/eplus.py | 14 | Python | 0.857 | refactor | 437 | 39 | 39 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | pzhlkj6612 | pzhlkj6612 |
raise UserNotLive('This event has not started yet')
elif delivery_status == 'STARTED':
# FIXME: HTTP request headers need to be updated to continue download
self.report_warning(
'Due to technical limitations, the download will be interrupted after one hour')
... | ```suggestion
r'var listChannels\s*=', webpage, 'hls URLs', video_id, contains_pattern=r'\[.+\]', default=[])
``` |
data_json = self._search_json(r'<script>\s*var app\s*=', webpage, 'data json', video_id)
delivery_status = data_json.get('delivery_status')
archive_mode = data_json.get('archive_mode')
release_timestamp = try_call(lambda: unified_timestamp(data_json['event_datetime']) - 32400)
... | @@ -0,0 +1,78 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ UserNotLive,
+ traverse_obj,
+ try_call,
+ unified_timestamp,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス) overseas'
+ _VALID_URL = r'https?://live\.eplus... | yt_dlp/extractor/eplus.py | 26 | Python | 0.714 | suggestion | 127 | 43 | 51 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pzhlkj6612 |
UserNotLive,
traverse_obj,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>([A-Za-z\d]|%2B|%2F){86}(%3D){2})'
_TESTS = [{
# simple fake url
... | ```suggestion
data_json = self._search_json(r'<script>\s*var app\s*=', webpage, 'data json', video_id)
``` | try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)'
_TESTS = [{
'url': 'https://live.eplus.jp/ex/player?ib=YEFxb3Vyc2Dombnjg7blkr... | @@ -0,0 +1,78 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ UserNotLive,
+ traverse_obj,
+ try_call,
+ unified_timestamp,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス) overseas'
+ _VALID_URL = r'https?://live\.eplus... | yt_dlp/extractor/eplus.py | 26 | Python | 0.714 | suggestion | 116 | 51 | 51 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pzhlkj6612 |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>([A-Za-z\d]|%2B|%2F){86}(%3D){2})'
_... | ```suggestion
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)'
``` | from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)'
_TESTS = ... | @@ -0,0 +1,110 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ try_call,
+ unified_timestamp,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス) overseas'
+ _VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>([A-Za-z\d... | yt_dlp/extractor/eplus.py | 12 | Python | 0.714 | suggestion | 111 | 37 | 37 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pzhlkj6612 |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>([A-Za-z\d]|%2B|%2F){86}(%3D){2})'
_... | Why are all tests "fake"? Use a real test that currently works for you locally and then add `'skip': 'live'` | from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)'
_TESTS = ... | @@ -0,0 +1,110 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ try_call,
+ unified_timestamp,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス) overseas'
+ _VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>([A-Za-z\d... | yt_dlp/extractor/eplus.py | 13 | Python | 0.571 | question | 108 | 38 | 38 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pzhlkj6612 |
webpage = self._download_webpage(url, video_id)
data_json = self._search_json(r'<script>\s*var app\s*=', webpage, 'data json', video_id)
delivery_status = data_json.get('delivery_status')
archive_mode = data_json.get('archive_mode')
release_timestamp = try_call(lambda: unified_... | Don't raise, issue warning try to extract as-if `is_live`. | if delivery_status == 'PREPARING':
live_status = 'is_upcoming'
elif delivery_status == 'STARTED':
live_status = 'is_live'
elif delivery_status == 'STOPPED':
if archive_mode != 'ON':
raise ExtractorError(
'This event has ende... | @@ -0,0 +1,110 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ try_call,
+ unified_timestamp,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス) overseas'
+ _VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>([A-Za-z\d... | yt_dlp/extractor/eplus.py | 26 | Python | 0.429 | refactor | 58 | 51 | 51 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pzhlkj6612 |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)'
_TESTS = ... | Update test; need to remove `timestamp` | from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_call,
unified_timestamp,
)
class EplusIbIE(InfoExtractor):
IE_NAME = 'eplus:inbound'
IE_DESC = 'e+ (イープラス) overseas'
_VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%2F){86}%3D%3D)'
_TESTS = ... | @@ -0,0 +1,99 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ try_call,
+ unified_timestamp,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス) overseas'
+ _VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%... | yt_dlp/extractor/eplus.py | 20 | Python | 0.286 | suggestion | 39 | 45 | 45 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | pzhlkj6612 |
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data_json = self._search_json(r'<script>\s*var app\s*=', webpage, 'data json', video_id)
delivery_status = data_json.get('delivery_status')
archive_mode = da... | Do we want `--wait-for-video` to wait for the VOD? Seems like `post_live` might be more appropriate. Although if we can be sure `--wait-for-video` will not be endless, then it is fine as-is
```suggestion
elif delivery_status == 'WAIT_CONFIRM_ARCHIVED':
live_status = 'post_live'
``` | def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
data_json = self._search_json(r'<script>\s*var app\s*=', webpage, 'data json', video_id)
delivery_status = data_json.get('delivery_status')
archive_mode = data_json.... | @@ -0,0 +1,99 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ try_call,
+ unified_timestamp,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス) overseas'
+ _VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%... | yt_dlp/extractor/eplus.py | 26 | Python | 0.786 | question | 306 | 51 | 51 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | pzhlkj6612 |
'This event has ended and there is no archive for this event', expected=True)
live_status = 'is_upcoming'
elif delivery_status == 'WAIT_CONFIRM_ARCHIVED':
live_status = 'is_upcoming'
elif delivery_status == 'CONFIRMED_ARCHIVE':
live_status = 'was_l... | If the above suggestion is applied, you can also do this
```suggestion
elif live_status == 'is_upcoming':
self.raise_no_formats(f'This live event will begin at {release_timestamp_str} JST', expected=True)
elif live_status == 'post_live':
self.raise_no_formats('This event has... | elif delivery_status == 'WAIT_CONFIRM_ARCHIVED':
live_status = 'post_live'
elif delivery_status == 'CONFIRMED_ARCHIVE':
live_status = 'was_live'
else:
self.report_warning(f'Unknown delivery_status {delivery_status}, treat it as a live')
live_status... | @@ -0,0 +1,99 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ try_call,
+ unified_timestamp,
+)
+
+
+class EplusIbIE(InfoExtractor):
+ IE_NAME = 'eplus:inbound'
+ IE_DESC = 'e+ (イープラス) overseas'
+ _VALID_URL = r'https?://live\.eplus\.jp/ex/player\?ib=(?P<id>(?:\w|%2B|%... | yt_dlp/extractor/eplus.py | 26 | Python | 0.786 | suggestion | 391 | 45 | 42 | false | [extractor/eplus] Add extractor for URLs from "ib.eplus.jp" | 5,782 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | pzhlkj6612 |
'url': 'https://iclr.cc/virtual_2020/poster_Hklr204Fvr.html',
'info_dict': {
'id': '38925850',
'ext': 'mp4',
'title': 'Towards a Deep Network Architecture for Structured Smoothness',
'thumbnail': r're:^https?://.*\.jpg',
'timestamp': 1629671508... | ```suggestion
@classmethod
def _extract_embed_urls(cls, url, webpage):
# Reference: https://slideslive.com/embed_presentation.js
for embed_id in re.findall(r'(?s)new\s+SlidesLiveEmbed\s*\([^\)]+\bpresentationId:\s*["\'](\d+)["\']', webpage):
url_parsed = urllib.parse.urlparse(ur... | 'upload_date': '20220608',
'chapters': 'count:6',
},
'params': {
'skip_download': 'm3u8',
},
}, {
# /v2/ slides (.jpg)
'url': 'https://slideslive.com/38954074',
'info_dict': {
'id': '38954074',
'ext': 'mp4',
... | @@ -96,6 +123,49 @@ class SlidesLiveIE(InfoExtractor):
'only_matching': True,
}]
+ _WEBPAGE_TESTS = [{
+ 'url': 'https://iclr.cc/virtual_2020/poster_Hklr204Fvr.html',
+ 'info_dict': {
+ 'id': '38925850',
+ 'ext': 'mp4',
+ 'title': 'Towards a Deep Network... | yt_dlp/extractor/slideslive.py | 26 | Python | 0.857 | refactor | 628 | 51 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
if not line.startswith('#EXT-SL-'):
continue
tag, _, value = line.partition(':')
key = lookup.get(tag.lstrip('#EXT-SL-'))
if not key:
continue
m3u8_dict[key] = value
# Some values are stringified JSON arrays
for... | it may be usefull to move this into a function
```py
def _download_embed_webpage_handle(video_id, headers):
return self._download_webpage_handle(
f'https://slideslive.com/embed/presentation/{video_id}', video_id,
headers=headers, query=traverse_obj(headers, {
... | 'info_dict': {
'id': '38979682-playlist',
'title': 'LoRA: Low-Rank Adaptation of Large Language Models',
},
'playlist': [{
'info_dict': {
'id': '38979682',
'ext': 'mp4',
'title': 'LoRA: Low-Rank Adaptation of Lar... | @@ -127,8 +198,31 @@ def _extract_custom_m3u8_info(self, m3u8_data):
return m3u8_dict
def _real_extract(self, url):
- video_id = self._match_id(url)
- webpage = self._download_webpage(url, video_id)
+ video_id, original_query = self._match_id(url), parse_qs(url)
+ webpage, ur... | yt_dlp/extractor/slideslive.py | 26 | Python | 1 | refactor | 903 | 51 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
@classmethod
def _extract_from_webpage(cls, url, webpage):
# Reference: https://slideslive.com/embed_presentation.js
for embed_id in re.findall(r'(?s)new\s+SlidesLiveEmbed\s*\([^\)]+\bpresentationId:\s*["\'](\d+)["\']', webpage):
url_parsed = urllib.parse.urlparse(url)
or... | Why put it into a custom dict only to unpack it immediately | 'timestamp': 1622806321,
'upload_date': '20210604',
'chapters': 'count:15',
},
'params': {
'skip_download': 'm3u8',
},
}, {
# /v4/ slides (.png)
'url': 'https://slideslive.com/38979570/',
'info_dict': {
'id':... | @@ -96,6 +123,49 @@ class SlidesLiveIE(InfoExtractor):
'only_matching': True,
}]
+ _WEBPAGE_TESTS = [{
+ 'url': 'https://iclr.cc/virtual_2020/poster_Hklr204Fvr.html',
+ 'info_dict': {
+ 'id': '38925850',
+ 'ext': 'mp4',
+ 'title': 'Towards a Deep Network... | yt_dlp/extractor/slideslive.py | 26 | Python | 0.214 | suggestion | 59 | 51 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
thumbnails = []
if url_or_none(player_info.get('thumbnail')):
thumbnails.append({
'id': '0',
'url': player_info['thumbnail'],
})
thumbnails.extend(traverse_obj(slides, (..., {
'id': 'id',
'url': 'url',
})))
... | ```suggestion
slides_xml = None
if player_info.get('slides_xml_url'):
slides_xml = self._download_xml(
player_info['slides_xml_url'], video_id, fatal=False,
note='Downloading slides XML', errnote='Failed to download slides XML')
chapters, thumb... | 'id': '38979481-013',
'ext': 'mp4',
'title': 'How to Train Your MAML to Excel in Few-Shot Classification - Slide 013',
'duration': 3,
'timestamp': 1654714877,
'upload_date': '20220608',
},
}],
'pa... | @@ -139,6 +233,40 @@ def _real_extract(self, url):
assert service_name in ('url', 'yoda', 'vimeo', 'youtube')
service_id = player_info['service_id']
+ slides = []
+ if player_info.get('slides_xml_url'):
+ slides_xml = self._download_xml(
+ player_info['slides_... | yt_dlp/extractor/slideslive.py | 26 | Python | 0.786 | bug | 1,035 | 51 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
import re
import urllib.parse
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
parse_qs,
smuggle_url,
traverse_obj,
unified_timestamp,
update_url_query,
url_or_none,
xpath_text,
)
class SlidesLiveIE(InfoExtractor):
_VALID_URL = r'https?://sl... | ```suggestion
elif player_info.get('slides_xml_url'):
``` | 'Origin': f'https://{domain}',
})
player_token = self._search_regex(r'data-player-token="([^"]+)"', webpage, 'player token')
player_data = self._download_webpage(
f'https://ben.slideslive.com/player/{video_id}', video_id,
note='Downloading player info... | @@ -139,6 +277,51 @@ def _real_extract(self, url):
assert service_name in ('url', 'yoda', 'vimeo', 'youtube')
service_id = player_info['service_id']
+ slides, slides_xml = None, None
+ slide_url_template = self._JPG_SLIDE_TMPL
+ chapters, thumbnails = [], []
+ if url_or_n... | yt_dlp/extractor/slideslive.py | 26 | Python | 0.571 | suggestion | 67 | 373 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
assert service_name in ('url', 'yoda', 'vimeo', 'youtube')
service_id = player_info['service_id']
slides, slides_xml = None, None
slide_url_template = self._JPG_SLIDE_TMPL
chapters, thumbnails = [], []
if url_or_none(player_info.get('thumbnail')):
thumbnails.... | not `slide_name`? If there's no chapter title, core code will add `<Untitled chapter i>`
https://github.com/yt-dlp/yt-dlp/blob/c73355510629e3eda5a79d4e2876a35316ca6ed2/yt_dlp/YoutubeDL.py#L2517-L2525 | 'tags': [],
'channel_follower_count': int,
'like_count': int,
'view_count': int,
'thumbnail': r're:^https?://.*\.(?:jpg|png|webp)',
'thumbnails': 'count:21',
'chapters': 'count:20',
},
'params': {
'skip_downl... | @@ -139,6 +277,51 @@ def _real_extract(self, url):
assert service_name in ('url', 'yoda', 'vimeo', 'youtube')
service_id = player_info['service_id']
+ slides, slides_xml = None, None
+ slide_url_template = self._JPG_SLIDE_TMPL
+ chapters, thumbnails = [], []
+ if url_or_n... | yt_dlp/extractor/slideslive.py | 26 | Python | 0.571 | suggestion | 202 | 51 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
slides, slides_xml = None, None
slide_url_template = self._JPG_SLIDE_TMPL
chapters, thumbnails = [], []
if url_or_none(player_info.get('thumbnail')):
thumbnails.append({'url': player_info['thumbnail']})
if player_info.get('slides_json_url'):
slides = tra... | ```suggestion
for slide in slides:
slide_name = traverse_obj(slide, ('image', 'name'))
if slide_name:
thumbnails.append({
'url': slide_url_template % (video_id, slide_name),
})
chapters.app... | 'like_count': int,
'view_count': int,
'thumbnail': r're:^https?://.*\.(?:jpg|png|webp)',
'thumbnails': 'count:21',
'chapters': 'count:20',
},
'params': {
'skip_download': 'm3u8',
},
}, {
# service_name = yoda
... | @@ -139,6 +277,51 @@ def _real_extract(self, url):
assert service_name in ('url', 'yoda', 'vimeo', 'youtube')
service_id = player_info['service_id']
+ slides, slides_xml = None, None
+ slide_url_template = self._JPG_SLIDE_TMPL
+ chapters, thumbnails = [], []
+ if url_or_n... | yt_dlp/extractor/slideslive.py | 26 | Python | 0.786 | suggestion | 428 | 51 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
})
player_token = self._search_regex(r'data-player-token="([^"]+)"', webpage, 'player token')
player_data = self._download_webpage(
f'https://ben.slideslive.com/player/{video_id}', video_id,
note='Downloading player info', query={'player_token': player_token})
... | My suggestion was assuming that `slide_id` is not needed. If it is, enumerate, not manually increment
```suggestion
for slide_id, slide in enumerate(slides):
``` | 'uploader_url': 'http://www.youtube.com/channel/UC62SdArr41t_-_fX40QCLRw',
'upload_date': '20200903',
'timestamp': 1602599092,
'duration': 942,
'age_limit': 0,
'live_status': 'not_live',
'playable_in_embed': True,
'availabil... | @@ -139,6 +277,51 @@ def _real_extract(self, url):
assert service_name in ('url', 'yoda', 'vimeo', 'youtube')
service_id = player_info['service_id']
+ slides, slides_xml, slide_id = None, None, 1
+ slide_url_template = self._JPG_SLIDE_TMPL
+ chapters, thumbnails = [], []
+ ... | yt_dlp/extractor/slideslive.py | 26 | Python | 0.714 | suggestion | 176 | 51 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
subtitles = {}
for sub in traverse_obj(player_info, ('subtitles', ...), expected_type=dict):
webvtt_url = url_or_none(sub.get('webvtt_url'))
if not webvtt_url:
continue
subtitles.setdefault(sub.get('language') or 'en', []).append({
'url... | ```suggestion
info['formats'] = self._extract_formats(player_info['video_servers'][0], service_id, video_id)
``` | subtitles = {}
for sub in traverse_obj(player_info, ('subtitles', ...), expected_type=dict):
webvtt_url = url_or_none(sub.get('webvtt_url'))
if not webvtt_url:
continue
subtitles.setdefault(sub.get('language') or 'en', []).append({
'url... | @@ -154,25 +465,17 @@ def _real_extract(self, url):
'title': player_info.get('title') or self._html_search_meta('title', webpage, default=''),
'timestamp': unified_timestamp(player_info.get('timestamp')),
'is_live': player_info.get('playlist_type') != 'vod',
- 'thumbnai... | yt_dlp/extractor/slideslive.py | 26 | Python | 0.786 | refactor | 126 | 51 | 51 | false | [extractor/slideslive] Add support for embeds and slideshows | 5,784 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_duration,
parse_iso8601
)
class KikaIE(InfoExtractor):
IE_DESC = 'KiKA.de'
_VALID_URL = r'https?://(?:www\.)?kika\.de/(?:.*)/[a-z-]+-?(?P<id>\d+)(?... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?kika\.de/[^/?#]+/[\w-]+(?P<id>\d+)'
``` | from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_duration,
parse_iso8601,
url_or_none,
)
from ..utils.traversal import traverse_obj
class KikaIE(InfoExtractor):
IE_DESC = 'KiKA.de'
_VALID_URL = r'https?://(?:www\.)?kika\.de/[\w/-]+/videos/(?P<id>[a-... | @@ -0,0 +1,93 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ int_or_none,
+ parse_duration,
+ parse_iso8601
+)
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?kika\.... | yt_dlp/extractor/kika.py | 15 | Python | 0.571 | suggestion | 93 | 40 | 40 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | 1100101 |
def _real_extract(self, url):
video_id = self._match_id(url)
doc = self._download_json("https://www.kika.de/_next-api/proxy/v1/videos/video%s" % (video_id), video_id)
title = doc.get('title')
timestamp = parse_iso8601(doc.get('date'))
duration = parse_duration(doc.get('durat... | ```suggestion
subtitles = {}
ttml_resource = video_assets.get('videoSubtitle')
if ttml_resource:
subtitles['de'] = [{
'url': ttml_resource,
'ext': 'ttml',
}]
webvtt_resource = video_assets.get('webvttUrl')
if webvtt... | }, {
'url': 'https://www.kika.de/kaltstart/videos/video92498',
'md5': '710ece827e5055094afeb474beacb7aa',
'info_dict': {
'id': 'video92498',
'ext': 'mp4',
'title': '7. Wo ist Leo?',
'description': 'md5:fb48396a5b75068bcac1df74f1524920',
... | @@ -0,0 +1,93 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ int_or_none,
+ parse_duration,
+ parse_iso8601
+)
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?kika\.... | yt_dlp/extractor/kika.py | 26 | Python | 0.786 | suggestion | 475 | 51 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | 1100101 |
'subtitles': subtitles,
'uploader': 'KIKA'
}
def _extract_formats(self, media_info, video_id):
streams = media_info.get('assets', [])
formats = []
for num, media in enumerate(streams):
stream_url = media.get("url")
ext = determine_ext(... | ```suggestion
def _extract_formats(self, media_info, video_id):
for media in media_info['assets']:
stream_url = media.get('url')
if not stream_url:
continue
ext = determine_ext(stream_url)
if ext == 'm3u8':
yield from se... | 'season': 'Season 1',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
doc = self._download_json(f'https://www.kika.de/_next-api/proxy/v1/videos/{video_id}', video_id)
video_assets = self._download_json(doc['assets']['url'], video_id)
subt... | @@ -0,0 +1,93 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ int_or_none,
+ parse_duration,
+ parse_iso8601
+)
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?kika\.... | yt_dlp/extractor/kika.py | 26 | Python | 1 | refactor | 939 | 27 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | 1100101 |
'skip': '404 not found',
}, {
# audio with alternative playerURL pattern
'url': 'http://www.mdr.de/kultur/videos-und-audios/audio-radio/operation-mindfuck-robert-wilson100.html',
'info_dict': {
'id': '100',
'ext': 'mp4',
'title': 'Feature: Operatio... | add this test to new extractor | },
'skip': '404 not found',
}, {
# audio with alternative playerURL pattern
'url': 'http://www.mdr.de/kultur/videos-und-audios/audio-radio/operation-mindfuck-robert-wilson100.html',
'info_dict': {
'id': '100',
'ext': 'mp4',
'title': 'Featur... | @@ -33,30 +33,6 @@ class MDRIE(InfoExtractor):
'uploader': 'MITTELDEUTSCHER RUNDFUNK',
},
'skip': '404 not found',
- }, {
- 'url': 'http://www.kika.de/baumhaus/videos/video19636.html',
- 'md5': '4930515e36b06c111213e80d1e4aad0e',
- 'info_dict': {
- 'id':... | yt_dlp/extractor/mdr.py | 26 | Python | 0.143 | refactor | 30 | 51 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | 1100101 |
formats = self._extract_formats(video_assets, video_id)
subtitles = {}
ttml_resource = video_assets.get('videoSubtitle')
if ttml_resource:
subtitles['de'] = [{
'url': ttml_resource,
'ext': 'ttml',
}]
webvtt_resource = video... | when changing extractors, you need to return https://github.com/yt-dlp/yt-dlp/blob/8fb80d909ce83a7827ca9bffd78495e37c0b5f52/yt_dlp/extractor/common.py#L347
Assuming the id is same b/w the extractors, it'll look like
```py
'_old_archive_ids': [f'MDR {video_id}']
``` | 'upload_date': '20231218',
'episode_number': 7,
'modified_date': '20240319',
'modified_timestamp': 1710880610,
'episode': 'Episode 7',
'season_number': 1,
'season': 'Season 1',
},
}, {
'url': 'https://www.kika.de/ber... | @@ -0,0 +1,93 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ int_or_none,
+ parse_duration,
+ parse_iso8601
+)
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?kika\.... | yt_dlp/extractor/kika.py | 26 | Python | 0.857 | refactor | 283 | 51 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | 1100101 |
data_url = self._search_regex(
r'(?:dataURL|playerXml(?:["\'])?)\s*:\s*(["\'])(?P<url>.+?-avCustom\.xml)\1',
webpage, 'data url', group='url').replace(r'\/', '/')
doc = self._download_xml(
compat_urlparse.urljoin(url, data_url), video_id)
title = xpath_text(... | This test has uploader != kika. So why are we statically setting it in new code? |
data_url = self._search_regex(
r'(?:dataURL|playerXml(?:["\'])?)\s*:\s*(["\'])(?P<url>.+?-avCustom\.xml)\1',
webpage, 'data url', group='url').replace(r'\/', '/')
doc = self._download_xml(
urllib.parse.urljoin(url, data_url), video_id)
title = xpath_text(do... | @@ -67,28 +43,7 @@ class MDRIE(InfoExtractor):
'duration': 3239,
'uploader': 'MITTELDEUTSCHER RUNDFUNK',
},
- }, {
- # empty bitrateVideo and bitrateAudio
- 'url': 'https://www.kika.de/filme/sendung128372_zc-572e3f45_zs-1d9fb70e.html',
- 'info_dict': {
- ... | yt_dlp/extractor/mdr.py | 26 | Python | 0.214 | question | 80 | 51 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | 1100101 |
return {
'id': video_id,
'title': doc.get('title'),
'description': doc.get('description'),
'timestamp': parse_iso8601(doc.get('date')),
'duration': parse_duration(doc.get('duration')),
'formats': formats,
'subtitles': subtitles... | ```suggestion
doc = self._download_json(f'https://www.kika.de/_next-api/proxy/v1/videos/video{video_id}', video_id)
video_assets = self._download_json(doc['assets']['url'], video_id)
subtitles = {}
ttml_resource = video_assets.get('videoSubtitle')
if ttml_resource:
... | 'season': 'Season 1',
},
}, {
'url': 'https://www.kika.de/bernd-das-brot/astrobrot/videos/video90088',
'md5': 'ffd1b700d7de0a6616a1d08544c77294',
'info_dict': {
'id': 'video90088',
'ext': 'mp4',
'upload_date': '20221102',
't... | @@ -0,0 +1,82 @@
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ parse_duration,
+ parse_iso8601,
+ traverse_obj
+)
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?kika\.de/(?:.*)/[a-z-]+-?(?P<id>\d+)'
+ _GEO_COUNTRIES = ['DE'... | yt_dlp/extractor/kika.py | 26 | Python | 0.857 | refactor | 1,039 | 34 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | 1100101 |
'md5': '710ece827e5055094afeb474beacb7aa',
'info_dict': {
'id': 'video92498',
'ext': 'mp4',
'title': '7. Wo ist Leo?',
'description': 'md5:fb48396a5b75068bcac1df74f1524920',
'duration': 436,
'timestamp': 1702926876,
'upl... | ```suggestion
if ttml_resource := url_or_none(video_assets.get('videoSubtitle')):
``` | 'md5': '710ece827e5055094afeb474beacb7aa',
'info_dict': {
'id': 'video92498',
'ext': 'mp4',
'title': '7. Wo ist Leo?',
'description': 'md5:fb48396a5b75068bcac1df74f1524920',
'duration': 436,
'timestamp': 1702926876,
'upl... | @@ -0,0 +1,107 @@
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?ki... | yt_dlp/extractor/kika.py | 26 | Python | 0.571 | suggestion | 95 | 51 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | 1100101 |
'description': 'md5:fb48396a5b75068bcac1df74f1524920',
'duration': 436,
'timestamp': 1702926876,
'upload_date': '20231218',
'episode_number': 7,
'modified_date': '20240319',
'modified_timestamp': 1710880610,
'episode': 'Epis... | ```suggestion
if webvtt_resource := url_or_none(video_assets.get('webvttUrl')):
``` | 'description': 'md5:fb48396a5b75068bcac1df74f1524920',
'duration': 436,
'timestamp': 1702926876,
'upload_date': '20231218',
'episode_number': 7,
'modified_date': '20240319',
'modified_timestamp': 1710880610,
'episode': 'Epis... | @@ -0,0 +1,107 @@
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?ki... | yt_dlp/extractor/kika.py | 26 | Python | 0.571 | suggestion | 93 | 51 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | 1100101 |
}]
if webvtt_resource := video_assets.get('webvttUrl'):
subtitles.setdefault('de', []).append({
'url': webvtt_resource,
'ext': 'vtt',
})
return {
'id': video_id,
'formats': list(self._extract_formats(video_asset... | ```suggestion
for media in traverse_obj(media_info, ('assets', lambda _, v: url_or_none(v['url']))):
``` | 'description': 'md5:d3641deaf1b5515a160788b2be4159a9',
'season_number': 1,
'episode': 'Episode 8',
'season': 'Season 1',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
doc = self._download_json(f'https://www.kika.de/_n... | @@ -0,0 +1,107 @@
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?ki... | yt_dlp/extractor/kika.py | 26 | Python | 0.714 | suggestion | 114 | 44 | 51 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | 1100101 |
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_duration,
parse_iso8601,
url_or_none,
)
from ..utils.traversal import traverse_obj
class KikaIE(InfoExtractor):
IE_DESC = 'KiKA.de'
_VALID_URL = r'https?://(?:www\.)?kika\.de/[\w-]+/videos/(?P<id>[a-z... | I'm guessing `fileSize` can (incorrectly) be `0` sometimes? might be worth a comment | 'timestamp': ('date', {parse_iso8601}),
'modified_timestamp': ('modificationDate', {parse_iso8601}),
'duration': ((
('durationInSeconds', {int_or_none}),
('duration', {parse_duration})), any),
'episode_number': ('epi... | @@ -0,0 +1,107 @@
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ url_or_none,
+)
+from ..utils.traversal import traverse_obj
+
+
+class KikaIE(InfoExtractor):
+ IE_DESC = 'KiKA.de'
+ _VALID_URL = r'https?://(?:www\.)?ki... | yt_dlp/extractor/kika.py | 26 | Python | 0.357 | bug | 84 | 108 | 31 | false | [ie/KiKA] Add extractor | 5,788 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | 1100101 |
'embed_parent_url': referer,
'embed_container_origin': f'https://{urllib.parse.urlparse(referer).netloc}',
})
return video_url
def _extract_videos(self, videos, url):
for video in traverse_obj(videos, ('videos', ...)):
video_id = video.get('yo... | ```suggestion
_VALID_URL = VideoKenBaseIE._BASE_URL_RE + r'(?:(?:topic|category)/[^/#?]+/)?video/(?P<id>[\w-]+)'
```
\w includes _ | video_url = f'https://slideslive.com/embed/{video_id.lstrip("slideslive-")}'
if url_or_none(referer):
return update_url_query(video_url, {
'embed_parent_url': referer,
'embed_container_origin': f'https://{urllib.parse.urlparse(referer).netloc}',
... | @@ -0,0 +1,354 @@
+import base64
+import itertools
+import time
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ update_url_query,
+ url_or_none,
+)
+
+
+class VideoKenBaseIE(InfoExtractor):
+ _BASE_URL_RE = r'''(?x)https?://
+ (?P<h... | yt_dlp/extractor/videoken.py | 26 | Python | 0.714 | suggestion | 137 | 51 | 51 | false | [extractor/videoken] Add extractors | 5,824 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
}, {
'url': 'https://videos.cncf.io/topic/kubernetes/video/YAM2d7yTrrI',
'only_matching': True,
}, {
'url': 'https://videos.icts.res.in/video/d7HuP_abpKU',
'only_matching': True,
}]
def _real_extract(self, url):
hostname, video_id = self._match_valid_url(url).gro... | ```suggestion
ie_key = SlidesLiveIE
```
is better imo | 'skip_download': 'm3u8',
},
}, {
'url': 'https://videos.cncf.io/category/478/video/IL4nxbmUIX8',
'only_matching': True,
}, {
'url': 'https://videos.cncf.io/topic/kubernetes/video/YAM2d7yTrrI',
'only_matching': True,
}, {
'url': 'https://videos.icts... | @@ -0,0 +1,354 @@
+import base64
+import itertools
+import time
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ update_url_query,
+ url_or_none,
+)
+
+
+class VideoKenBaseIE(InfoExtractor):
+ _BASE_URL_RE = r'''(?x)https?://
+ (?P<h... | yt_dlp/extractor/videoken.py | 26 | Python | 0.643 | suggestion | 72 | 51 | 51 | false | [extractor/videoken] Add extractors | 5,824 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
def _real_extract(self, url):
video_id = self._match_id(url)
return self.url_result(
self._create_slideslive_url(None, video_id, url), 'SlidesLive', video_id)
class VideoKenPlaylistIE(VideoKenBaseIE):
_VALID_URL = VideoKenBaseIE._BASE_URL_RE + r'(?:category/\d+/)?playlist/(?P<id>\... | ```suggestion
return self.playlist_result(self._extract_videos(videos, url), playlist_id, videos.get('title'))
```
Don't fallback title=id | 'skip_download': 'm3u8',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
return self.url_result(
self._create_slideslive_url(None, video_id, url), SlidesLiveIE, video_id)
class VideoKenPlaylistIE(VideoKenBaseIE):
_VALID_URL = VideoKenBase... | @@ -0,0 +1,354 @@
+import base64
+import itertools
+import time
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ update_url_query,
+ url_or_none,
+)
+
+
+class VideoKenBaseIE(InfoExtractor):
+ _BASE_URL_RE = r'''(?x)https?://
+ (?P<h... | yt_dlp/extractor/videoken.py | 26 | Python | 0.786 | refactor | 149 | 51 | 51 | false | [extractor/videoken] Add extractors | 5,824 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'playlist_mincount': 100,
'info_dict': {
'id': '479',
'title': 'KubeCon + CloudNativeCon Europe\'19',
},
}]
def _get_category_page(self, category_id, org_id, page=1, note=None):
return self._download_json(
f'https://analytics.videoken.com/api/... | Is this not enough?
```suggestion
yield from self._extract_videos(videos, url)
if videos.get('is_last_page') is not False:
break
``` | }, {
'url': 'https://videos.cncf.io/category/479/',
'playlist_mincount': 328,
'info_dict': {
'id': '479',
'title': 'KubeCon + CloudNativeCon Europe\'19',
},
}]
def _get_category_page(self, category_id, org_id, page=1, note=None):
return self._... | @@ -0,0 +1,354 @@
+import base64
+import itertools
+import time
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ update_url_query,
+ url_or_none,
+)
+
+
+class VideoKenBaseIE(InfoExtractor):
+ _BASE_URL_RE = r'''(?x)https?://
+ (?P<h... | yt_dlp/extractor/videoken.py | 26 | Python | 0.786 | refactor | 179 | 51 | 51 | false | [extractor/videoken] Add extractors | 5,824 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'playlist_mincount': 100,
'info_dict': {
'id': '479',
'title': 'KubeCon + CloudNativeCon Europe\'19',
},
}]
def _get_category_page(self, category_id, org_id, page=1, note=None):
return self._download_json(
f'https://analytics.videoken.com/api/... | Is the number of entries per page fixed? If so, this can be a PagedList | }, {
'url': 'https://videos.cncf.io/category/479/',
'playlist_mincount': 328,
'info_dict': {
'id': '479',
'title': 'KubeCon + CloudNativeCon Europe\'19',
},
}]
def _get_category_page(self, category_id, org_id, page=1, note=None):
return self._... | @@ -0,0 +1,354 @@
+import base64
+import itertools
+import time
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ update_url_query,
+ url_or_none,
+)
+
+
+class VideoKenBaseIE(InfoExtractor):
+ _BASE_URL_RE = r'''(?x)https?://
+ (?P<h... | yt_dlp/extractor/videoken.py | 26 | Python | 0.214 | suggestion | 71 | 51 | 51 | false | [extractor/videoken] Add extractors | 5,824 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'is_topic': 'true',
'category': '',
'searchid': search_id,
}, headers={'Accept': 'application/json'}, note=f'Downloading topic page {page}') or {}
def _entries(self, topic, org_id, search_id, api_key, url):
for page in itertools.count(1):
... | almost same code as single video. Can it be generalized? | import base64
import functools
import math
import re
import time
import urllib.parse
from .common import InfoExtractor
from .slideslive import SlidesLiveIE
from ..utils import (
ExtractorError,
InAdvancePagedList,
int_or_none,
traverse_obj,
update_url_query,
url_or_none,
)
class VideoKenBaseI... | @@ -0,0 +1,354 @@
+import base64
+import itertools
+import time
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ update_url_query,
+ url_or_none,
+)
+
+
+class VideoKenBaseIE(InfoExtractor):
+ _BASE_URL_RE = r'''(?x)https?://
+ (?P<h... | yt_dlp/extractor/videoken.py | 26 | Python | 0.214 | question | 56 | 38 | 337 | false | [extractor/videoken] Add extractors | 5,824 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
'searchid': search_id,
}, headers={'Accept': 'application/json'}, note=f'Downloading topic page {page}') or {}
def _entries(self, topic, org_id, search_id, api_key, url):
for page in itertools.count(1):
videos = self._get_topic_page(topic, org_id, search_id, api_key,... | ```suggestion
if page >= total_pages:
```
just in case | import base64
import functools
import math
import re
import time
import urllib.parse
from .common import InfoExtractor
from .slideslive import SlidesLiveIE
from ..utils import (
ExtractorError,
InAdvancePagedList,
int_or_none,
traverse_obj,
update_url_query,
url_or_none,
)
class VideoKenBaseI... | @@ -0,0 +1,354 @@
+import base64
+import itertools
+import time
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ update_url_query,
+ url_or_none,
+)
+
+
+class VideoKenBaseIE(InfoExtractor):
+ _BASE_URL_RE = r'''(?x)https?://
+ (?P<h... | yt_dlp/extractor/videoken.py | 26 | Python | 0.571 | suggestion | 69 | 36 | 337 | false | [extractor/videoken] Add extractors | 5,824 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
import base64
import itertools
import time
import urllib.parse
from .common import InfoExtractor
from ..utils import (
int_or_none,
traverse_obj,
update_url_query,
url_or_none,
)
class VideoKenBaseIE(InfoExtractor):
_BASE_URL_RE = r'''(?x)https?://
(?P<host>videos\.(?:
icts\.r... | ```suggestion
_ORGANIZATIONS = {
'videos.icts.res.in': 'icts',
'videos.cncf.io': 'cncf',
'videos.neurips.cc': 'neurips',
}
_BASE_URL_RE = rf'https?://(?P<host>{"|".join(map(re.escape, _ORGANIZATIONS)})/'
``` | import base64
import functools
import math
import re
import time
import urllib.parse
from .common import InfoExtractor
from .slideslive import SlidesLiveIE
from ..utils import (
ExtractorError,
InAdvancePagedList,
int_or_none,
traverse_obj,
update_url_query,
url_or_none,
)
class VideoKenBaseI... | @@ -0,0 +1,354 @@
+import base64
+import itertools
+import time
+import urllib.parse
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ update_url_query,
+ url_or_none,
+)
+
+
+class VideoKenBaseIE(InfoExtractor):
+ _BASE_URL_RE = r'''(?x)https?://
+ (?P<h... | yt_dlp/extractor/videoken.py | 25 | Python | 0.786 | security | 250 | 50 | 50 | false | [extractor/videoken] Add extractors | 5,824 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
profileId = profileIds[0]
profileIdHash = profileIdHashes[0]
chooseProfileResultWebpage = self._download_json(
'https://www.hidive.com/ajax/chooseprofile', '',
data=urlencode_postdata({
'profileId': profileId,
'hash': profileIdHash,
... | Duplicate API call - Pass it into the function from _real_extract | 'hash': profile_id_hash,
'returnUrl': '/dashboard'
}))
def _call_api(self, video_id, title, key, data={}, **kwargs):
data = {
**data,
'Title': title,
'Key': key,
'PlayerId': 'f4f895ce1ca713ba263b91caeb1daa2d08904783... | @@ -60,24 +76,22 @@ def _call_api(self, video_id, title, key, data={}, **kwargs):
'https://www.hidive.com/play/settings', video_id,
data=urlencode_postdata(data), **kwargs) or {}
- def _extract_subtitles_from_rendition(self, rendition, subtitles, parsed_urls):
- for cc_file in rend... | yt_dlp/extractor/hidive.py | 26 | Python | 0.286 | refactor | 65 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
'skip': 'Requires Authentication',
}]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)... | * Use `self._search_regex`
* Simplify regex (`a-zA-Z0-9` => `\w` etc)
* Avoid `.*` |
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
if not form:
return
d... | @@ -46,8 +46,24 @@ def _perform_login(self, username, password):
'Email': username,
'Password': password,
})
- self._download_webpage(
+ loginWebpage = self._download_webpage(
self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data))
+ # If ... | yt_dlp/extractor/hidive.py | 26 | Python | 0.429 | refactor | 84 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
if not form: # logged in
ret... | ```suggestion
'https://www.hidive.com/ajax/chooseprofile', None,
``` | webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
if not form:
return
data = self._hidden_inputs(form)
data.update... | @@ -46,8 +46,24 @@ def _perform_login(self, username, password):
'Email': username,
'Password': password,
})
- self._download_webpage(
+ loginWebpage = self._download_webpage(
self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data))
+ # If ... | yt_dlp/extractor/hidive.py | 26 | Python | 0.571 | suggestion | 82 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
}]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
if not form: # logged in
... | unused? Use `_request_webpage` if the reply is to be discarded | def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
if not form:
return
da... | @@ -46,8 +46,24 @@ def _perform_login(self, username, password):
'Email': username,
'Password': password,
})
- self._download_webpage(
+ loginWebpage = self._download_webpage(
self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data))
+ # If ... | yt_dlp/extractor/hidive.py | 26 | Python | 0.429 | suggestion | 62 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
_GEO_BYPASS = False
_NETRC_MACHINE = 'hidive'
_LOGIN_URL = 'https://www.hidive.com/account/login'
_TESTS = [{
'url': 'https://www.hidive.com/stream/the-comic-artist-and-his-assistants/s01e001',
'info_dict': {
'id': 'the-comic-artist-and-his-assistants/s01e001',
'... | ```suggestion
if not form: # already logged in
``` | _LOGIN_URL = 'https://www.hidive.com/account/login'
_TESTS = [{
'url': 'https://www.hidive.com/stream/the-comic-artist-and-his-assistants/s01e001',
'info_dict': {
'id': 'the-comic-artist-and-his-assistants/s01e001',
'ext': 'mp4',
'title': 'the-comic-artist-an... | @@ -39,15 +39,31 @@ def _perform_login(self, username, password):
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
- if not form: # logged in
+ if not form: # already logged in, so no more action... | yt_dlp/extractor/hidive.py | 26 | Python | 0.571 | suggestion | 60 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
},
'params': {
'skip_download': True,
},
'skip': 'Requires Authentication',
}]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/accoun... | ```suggestion
# If the user has multiple profiles on their account, select one. For now pick the first profile
``` | 'skip_download': True,
},
'skip': 'Requires Authentication',
}]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
... | @@ -39,15 +39,31 @@ def _perform_login(self, username, password):
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
- if not form: # logged in
+ if not form: # already logged in, so no more action... | yt_dlp/extractor/hidive.py | 26 | Python | 0.786 | suggestion | 124 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
'params': {
'skip_download': True,
},
'skip': 'Requires Authentication',
}]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>... | ```suggestion
profile_id = self._search_regex(r'<button [^>]+data-profile-id="(\w+)"', login_webpage, 'profile_id')
``` | },
'skip': 'Requires Authentication',
}]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', de... | @@ -39,15 +39,31 @@ def _perform_login(self, username, password):
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
- if not form: # logged in
+ if not form: # already logged in, so no more action... | yt_dlp/extractor/hidive.py | 26 | Python | 0.714 | suggestion | 129 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
},
'skip': 'Requires Authentication',
}]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', de... | ```suggestion
return # If only one profile, Hidive auto-selects it
``` | }]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
if not form:
return
... | @@ -39,15 +39,31 @@ def _perform_login(self, username, password):
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
- if not form: # logged in
+ if not form: # already logged in, so no more action... | yt_dlp/extractor/hidive.py | 26 | Python | 0.571 | suggestion | 84 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
'skip': 'Requires Authentication',
}]
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)... | ```suggestion
profile_id_hash = self._search_regex(r'<button [^>]+data-hash="(\w+)"', login_webpage, 'profile_id_hash')
``` |
def _perform_login(self, username, password):
webpage = self._download_webpage(self._LOGIN_URL, None)
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
if not form:
return
d... | @@ -39,15 +39,31 @@ def _perform_login(self, username, password):
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
- if not form: # logged in
+ if not form: # already logged in, so no more action... | yt_dlp/extractor/hidive.py | 26 | Python | 0.714 | suggestion | 133 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
webpage, 'login form', default=None)
if not form: # already logged in, so no more actions to take.
return
data = self._hidden_inputs(form)
data.update({
'Email': username,
'Password': password,
})
login_webpage = self._download_webp... | ```suggestion
}))
``` | return
data = self._hidden_inputs(form)
data.update({
'Email': username,
'Password': password,
})
login_webpage = self._download_webpage(
self._LOGIN_URL, None, 'Logging in', data=urlencode_postdata(data))
# If the user has multiple... | @@ -39,15 +39,31 @@ def _perform_login(self, username, password):
form = self._search_regex(
r'(?s)<form[^>]+action="/account/login"[^>]*>(.+?)</form>',
webpage, 'login form', default=None)
- if not form: # logged in
+ if not form: # already logged in, so no more action... | yt_dlp/extractor/hidive.py | 26 | Python | 0.429 | suggestion | 35 | 51 | 51 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
**data,
'Title': title,
'Key': key,
'PlayerId': 'f4f895ce1ca713ba263b91caeb1daa2d08904783',
}
return self._download_json(
'https://www.hidive.com/play/settings', video_id,
data=urlencode_postdata(data), **kwargs) or {}
def _get... | Since this makes no additional network calls, this can be moved into real_extract - specifically into the loop in L10 | 'https://www.hidive.com/play/settings', video_id,
data=urlencode_postdata(data), **kwargs) or {}
def _real_extract(self, url):
video_id, title, key = self._match_valid_url(url).group('id', 'title', 'key')
settings = self._call_api(video_id, title, key)
restriction =... | @@ -60,24 +76,23 @@ def _call_api(self, video_id, title, key, data={}, **kwargs):
'https://www.hidive.com/play/settings', video_id,
data=urlencode_postdata(data), **kwargs) or {}
- def _extract_subtitles_from_rendition(self, rendition, subtitles, parsed_urls):
- for cc_file in rend... | yt_dlp/extractor/hidive.py | 26 | Python | 0.429 | refactor | 117 | 51 | 50 | false | Fix Hidive - Subtitles and Age-restriction. | 5,828 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | chexxor |
def _extract_media_info(self, media_info_url, webpage, video_id):
media_info = self._download_json(
media_info_url, video_id, 'Downloading media JSON')
return self._parse_media_info(media_info, video_id, '"fsk"' in webpage)
def _parse_media_info(self, media_info, video_id, fsk):
... | ```suggestion
'url': subtitle_url.replace('/ebutt/"', '/webvtt/') + '.vtt',
``` | def _extract_media_info(self, media_info_url, webpage, video_id):
media_info = self._download_json(
media_info_url, video_id, 'Downloading media JSON')
return self._parse_media_info(media_info, video_id, '"fsk"' in webpage)
def _parse_media_info(self, media_info, video_id, fsk):
... | @@ -46,6 +46,9 @@ def _parse_media_info(self, media_info, video_id, fsk):
subtitles['de'] = [{
'ext': 'ttml',
'url': subtitle_url,
+ }, {
+ 'ext': 'vtt',
+ 'url': subtitle_url.replace("/ebutt/", "/webvtt/") + ".vtt", | yt_dlp/extractor/ard.py | 26 | Python | 0.643 | suggestion | 97 | 51 | 51 | false | [ARD] Add WebVTT subtitles | 5,835 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | CapacitorSet |
def _extract_media_info(self, media_info_url, webpage, video_id):
media_info = self._download_json(
media_info_url, video_id, 'Downloading media JSON')
return self._parse_media_info(media_info, video_id, '"fsk"' in webpage)
def _parse_media_info(self, media_info, video_id, fsk):
... | ```suggestion
'url': subtitle_url.replace('/ebutt/', '/webvtt/') + '.vtt',
```
| def _extract_media_info(self, media_info_url, webpage, video_id):
media_info = self._download_json(
media_info_url, video_id, 'Downloading media JSON')
return self._parse_media_info(media_info, video_id, '"fsk"' in webpage)
def _parse_media_info(self, media_info, video_id, fsk):
... | @@ -46,6 +46,9 @@ def _parse_media_info(self, media_info, video_id, fsk):
subtitles['de'] = [{
'ext': 'ttml',
'url': subtitle_url,
+ }, {
+ 'ext': 'vtt',
+ 'url': subtitle_url.replace('/ebutt/"', '/webvtt/') + '.vtt', | yt_dlp/extractor/ard.py | 26 | Python | 0.643 | suggestion | 98 | 51 | 51 | false | [ARD] Add WebVTT subtitles | 5,835 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | CapacitorSet |
'display_id': 'anies-baswedan-ajukan-banding-putusan-ptun-batalkan-ump-dki',
'ext': 'mp4',
'title': 'Anies Baswedan Ajukan Banding Putusan PTUN Batalkan UMP DKI',
'duration': 85,
'description': 'md5:a6822b7c4c874fa7e5bd63e96a387b66',
'thumbnail': '... | ```suggestion
tags=try_call(lambda: self._html_search_meta('keywords', webpage).split(',')),
```
otherwise `None.split` can raise |
class IVXPlayerIE(InfoExtractor):
_VALID_URL = r'ivxplayer:(?P<video_id>\d+):(?P<player_key>\w+)'
_TESTS = [{
'url': 'ivxplayer:2366065:4a89dfe6bc8f002596b1dfbd600730b1',
'info_dict': {
'id': '2366065',
'ext': 'mp4',
'duration': 112,
'upload_date'... | @@ -24,30 +24,16 @@ def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
- player_key, widget_id = self._search_regex(
- r'<ivs-player\s*[^>]+data-ivs-key\s*=\s*"(?P<player_key>[\w]+)[^>]+\bdata-ivs-wid="(?P<widget_id>[\w-... | yt_dlp/extractor/tempo.py | 26 | Python | 0.714 | suggestion | 144 | 30 | 51 | false | [extractor/tempo] Add IVXPlayer extractor | 5,837 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'duration': 85,
'description': 'md5:a6822b7c4c874fa7e5bd63e96a387b66',
'thumbnail': 'https://statik.tempo.co/data/2022/07/27/id_1128287/1128287_720.jpg',
'timestamp': 1658907970,
'upload_date': '20220727',
'tags': ['Anies Baswedan', ' PTUN', ' PTUN... | ```suggestion
description=(json_ld_data.get('description')
or self._html_search_meta(('description', 'twitter:description'), webpage)
or self._og_search_description(webpage)),
url_transparent=True)
``` | _TESTS = [{
'url': 'ivxplayer:2366065:4a89dfe6bc8f002596b1dfbd600730b1',
'info_dict': {
'id': '2366065',
'ext': 'mp4',
'duration': 112,
'upload_date': '20221204',
'title': 'Film Indonesia di Disney Content Showcase Asia Pacific 2022',
... | @@ -24,30 +24,16 @@ def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
- player_key, widget_id = self._search_regex(
- r'<ivs-player\s*[^>]+data-ivs-key\s*=\s*"(?P<player_key>[\w]+)[^>]+\bdata-ivs-wid="(?P<widget_id>[\w-... | yt_dlp/extractor/tempo.py | 26 | Python | 0.786 | suggestion | 280 | 27 | 51 | false | [extractor/tempo] Add IVXPlayer extractor | 5,837 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
class TempoIE(InfoExtractor):
_VALID_URL = r'https?://video\.tempo\.co/\w+/\d+/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://video.tempo.co/read/30058/anies-baswedan-ajukan-banding-putusan-ptun-batalkan-ump-dki',
'info_dict': {
'id': '2144275',
'display_id': 'anies-basweda... | ```suggestion
_, player_key, video_id = next(IVXPlayerIE._extract_embed_urls(url, webpage)).split(':')
``` | from ..utils import (
int_or_none,
parse_iso8601,
traverse_obj,
try_call
)
class IVXPlayerIE(InfoExtractor):
_VALID_URL = r'ivxplayer:(?P<video_id>\d+):(?P<player_key>\w+)'
_TESTS = [{
'url': 'ivxplayer:2366065:4a89dfe6bc8f002596b1dfbd600730b1',
'info_dict': {
'id':... | @@ -24,30 +24,16 @@ def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
- player_key, widget_id = self._search_regex(
- r'<ivs-player\s*[^>]+data-ivs-key\s*=\s*"(?P<player_key>[\w]+)[^>]+\bdata-ivs-wid="(?P<widget_id>[\w-... | yt_dlp/extractor/tempo.py | 26 | Python | 0.786 | refactor | 116 | 37 | 51 | false | [extractor/tempo] Add IVXPlayer extractor | 5,837 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from ..utils import try_call
class TempoIE(InfoExtractor):
_VALID_URL = r'https?://video\.tempo\.co/\w+/\d+/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://video.tempo.co/read/30058/anies-baswedan-ajukan-banding-putusan-ptun-batalkan-ump-dki',
'info_dict': {
... | The code for extracting id looks same. Why does this change? | import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_iso8601,
traverse_obj,
try_call
)
class IVXPlayerIE(InfoExtractor):
_VALID_URL = r'ivxplayer:(?P<video_id>\d+):(?P<player_key>\w+)'
_TESTS = [{
'url': 'ivxplayer:2366065:4a89dfe6bc8f002596b1dfbd600730... | @@ -1,20 +1,20 @@
from .common import InfoExtractor
-from ..utils import int_or_none, parse_iso8601, str_or_none, traverse_obj
+from ..utils import try_call
class TempoIE(InfoExtractor):
_VALID_URL = r'https?://video\.tempo\.co/\w+/\d+/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://video.tempo.co/... | yt_dlp/extractor/tempo.py | 10 | Python | 0.286 | refactor | 60 | 35 | 35 | false | [extractor/tempo] Add IVXPlayer extractor | 5,837 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
_TESTS = [{
'url': 'netsearch10:tetangga',
'info_dict': {
'id': 'tetangga',
'title': 'tetangga',
},
'playlist_count': 10,
}]
def _search_results(self, query):
last_page_number = None
for i in itertools.count(1):
search_data... | ```suggestion
def _search_results(self, query):
last_page = None
for i in itertools.count(1):
search_data = self._download_json(
'https://api.netverse.id/search/elastic/search', query,
query={'q': query, 'page': i}, note=f'Downloading page {i}')
... | import itertools
from .common import InfoExtractor, SearchInfoExtractor
from .dailymotion import DailymotionIE
from ..utils import smuggle_url, traverse_obj
class NetverseBaseIE(InfoExtractor):
_ENDPOINTS = {
'watch': 'watchvideo',
'video': 'watchvideo',
'webseries': 'webseries',
... | @@ -251,3 +251,34 @@ def _real_extract(self, url):
self.parse_playlist(playlist_data['response'], playlist_id),
traverse_obj(playlist_data, ('response', 'webseries_info', 'slug')),
traverse_obj(playlist_data, ('response', 'webseries_info', 'title')))
+
+
+class NetverseSearchIE(Se... | yt_dlp/extractor/netverse.py | 26 | Python | 0.786 | suggestion | 682 | 27 | 282 | false | [extractor/netverse] Add NetverseSearch extractor | 5,838 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
class NetverseSearchIE(SearchInfoExtractor):
_SEARCH_KEY = 'netsearch'
_TESTS = [{
'url': 'netsearch10:tetangga',
'info_dict': {
'id': 'tetangga',
'title': 'tetangga',
},
'playlist_count': 10,
}]
def _search_results(self, query):
last_pa... | ```suggestion
if not videos or i >= (last_page or 0):
``` |
class NetverseSearchIE(SearchInfoExtractor):
_SEARCH_KEY = 'netsearch'
_TESTS = [{
'url': 'netsearch10:tetangga',
'info_dict': {
'id': 'tetangga',
'title': 'tetangga',
},
'playlist_count': 10,
}]
def _search_results(self, query):
last_pa... | @@ -251,3 +251,31 @@ def _real_extract(self, url):
self.parse_playlist(playlist_data['response'], playlist_id),
traverse_obj(playlist_data, ('response', 'webseries_info', 'slug')),
traverse_obj(playlist_data, ('response', 'webseries_info', 'title')))
+
+
+class NetverseSearchIE(Se... | yt_dlp/extractor/netverse.py | 26 | Python | 0.571 | suggestion | 71 | 28 | 28 | false | [extractor/netverse] Add NetverseSearch extractor | 5,838 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'title': 'neilcic (All)',
},
'playlist_mincount': 23,
}]
_BASE_URL_MAP = {
'all': 'stream/users/%s',
'tracks': 'users/%s/tracks',
'albums': 'users/%s/albums',
'sets': 'users/%s/playlists',
'reposts': 'stream/users/%s/reposts',
'likes':... | Since it's a completely different URL pattern and code path, better to create a new class | 'sets': 'users/%s/playlists',
'reposts': 'stream/users/%s/reposts',
'likes': 'users/%s/likes',
'spotlight': 'users/%s/spotlight',
}
def _real_extract(self, url):
mobj = self._match_valid_url(url)
uploader = mobj.group('user')
user = self._download_json(
... | @@ -769,12 +778,17 @@ class SoundcloudUserIE(SoundcloudPagedPlaylistBaseIE):
def _real_extract(self, url):
mobj = self._match_valid_url(url)
uploader = mobj.group('user')
+ user_id = mobj.group('user_id')
- user = self._download_json(
- self._resolv_url(self._BASE_URL +... | yt_dlp/extractor/soundcloud.py | 26 | Python | 0.286 | suggestion | 89 | 51 | 51 | false | [extractor/soundcloud] Implement user permalink support | 5,842 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nosoop |
'%s (%s)' % (user['username'], resource.capitalize()))
class SoundcloudUserPermalinkIE(SoundcloudPagedPlaylistBaseIE):
_VALID_URL = r'https?://(?:api\.soundcloud\.com/users/(?P<user_id>\d+)$)'
IE_NAME = 'soundcloud:user_permalink'
_TESTS = [{
'url': 'https://api.soundcloud.com/users/30... | ```suggestion
class SoundcloudUserPermalinkIE(SoundcloudPagedPlaylistBaseIE):
_VALID_URL = r'https?://api\.soundcloud\.com/users/(?P<id>\d+)'
IE_NAME = 'soundcloud:user:permalink'
_TESTS = [{
'url': 'https://api.soundcloud.com/users/30909869',
'info_dict': {
'id': '3090986... | '%s (%s)' % (user['username'], resource.capitalize()))
class SoundcloudUserPermalinkIE(SoundcloudPagedPlaylistBaseIE):
_VALID_URL = r'https?://api\.soundcloud\.com/users/(?P<id>\d+)'
IE_NAME = 'soundcloud:user:permalink'
_TESTS = [{
'url': 'https://api.soundcloud.com/users/30909869',
... | @@ -782,6 +782,31 @@ def _real_extract(self, url):
'%s (%s)' % (user['username'], resource.capitalize()))
+class SoundcloudUserPermalinkIE(SoundcloudPagedPlaylistBaseIE):
+ _VALID_URL = r'https?://(?:api\.soundcloud\.com/users/(?P<user_id>\d+)$)'
+ IE_NAME = 'soundcloud:user_permalink'
+ _TEST... | yt_dlp/extractor/soundcloud.py | 26 | Python | 0.857 | refactor | 789 | 51 | 51 | false | [extractor/soundcloud] Implement user permalink support | 5,842 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nosoop |
return self._extract_playlist(
self._API_V2_BASE + self._BASE_URL_MAP[resource] % user['id'],
str_or_none(user.get('id')),
'%s (%s)' % (user['username'], resource.capitalize()))
class SoundcloudUserPermalinkIE(SoundcloudPagedPlaylistBaseIE):
_VALID_URL = r'https?://api\... | ```suggestion
f'{self._API_V2_BASE}stream/users/{user["id"]}', user['id'], user.get('username'))
``` | return self._extract_playlist(
self._API_V2_BASE + self._BASE_URL_MAP[resource] % user['id'],
str_or_none(user.get('id')),
'%s (%s)' % (user['username'], resource.capitalize()))
class SoundcloudUserPermalinkIE(SoundcloudPagedPlaylistBaseIE):
_VALID_URL = r'https?://api\... | @@ -782,6 +782,28 @@ def _real_extract(self, url):
'%s (%s)' % (user['username'], resource.capitalize()))
+class SoundcloudUserPermalinkIE(SoundcloudPagedPlaylistBaseIE):
+ _VALID_URL = r'https?://api\.soundcloud\.com/users/(?P<id>\d+)'
+ IE_NAME = 'soundcloud:user:permalink'
+ _TESTS = [{
+ ... | yt_dlp/extractor/soundcloud.py | 26 | Python | 0.786 | suggestion | 114 | 51 | 51 | false | [extractor/soundcloud] Implement user permalink support | 5,842 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nosoop |
class AmazonStoreIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?amazon\.(?:[a-z]{2,3})(?:\.[a-z]{2})?/(?:[^/]+/)?(?:dp|gp/product)/(?P<id>[^/&#$?]+)'
_TESTS = [{
'url': 'https://www.amazon.co.uk/dp/B098XNCHLD/',
'info_dict': {
'id': 'B098XNCHLD',
'title': 'md5:dae... | If these are not static, use weaker test definition. Eg:
```suggestion
'title': str,
``` |
class AmazonStoreIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?amazon\.(?:[a-z]{2,3})(?:\.[a-z]{2})?/(?:[^/]+/)?(?:dp|gp/product)/(?P<id>[^/&#$?]+)'
_TESTS = [{
'url': 'https://www.amazon.co.uk/dp/B098XNCHLD/',
'info_dict': {
'id': 'B098XNCHLD',
'title': str,
... | @@ -20,28 +32,32 @@ class AmazonStoreIE(InfoExtractor):
'thumbnail': r're:^https?://.*\.jpg$',
'duration': 34,
},
- }]
+ }],
+ 'expected_warnings': ['Unable to extract data'],
}, {
'url': 'https://www.amazon.in/Sony-WH-1000XM4-Cancelling-... | yt_dlp/extractor/amazon.py | 26 | Python | 0.786 | suggestion | 103 | 51 | 51 | false | [extractor/amazon] Add `AmazonReviewsIE` | 5,857 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
elif stream['protocol'] in ('HTTPS', 'RTMP'):
formats.append({
'format_id': f'{stream["protocol"]}-{stream_version_code}',
'url': stream['url'],
'format_note': f'{stream_version.get("label", "unknown")} [{short_label}]',
... | this code omits the last chapter in the API response.
the core code will set the `end_time` for you, so you can do this instead:
```suggestion
chapters = []
for chapter in traverse_obj(config, ('data', 'attributes', 'chapters', 'elements', ...)):
start_time = int_or_none(chapter.get... | self._merge_subtitles(subs, target=subtitles)
elif stream['protocol'] in ('HTTPS', 'RTMP'):
formats.append({
'format_id': f'{stream["protocol"]}-{stream_version_code}',
'url': stream['url'],
'format_note': f'{stream... | @@ -181,13 +195,18 @@ def _real_extract(self, url):
self.report_warning(f'Skipping stream with unknown protocol {stream["protocol"]}')
# TODO: chapters from stream['segments']?
- # The JS also looks for chapters in config['data']['attributes']['chapters'],
- # but I... | yt_dlp/extractor/arte.py | 26 | Python | 0.857 | suggestion | 535 | 51 | 51 | false | [ArteTV] extract chapters | 5,879 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | iw0nderhow |
metadata = config['data']['attributes']['metadata']
chapters = traverse_obj(config, ('data', 'attributes', 'chapters', 'elements'), expected_type=list)
if chapters:
chapters = [{
'start_time': chap.get('startTime'),
'end_time': next_chap.get('startTime... | ```suggestion
'chapters': chapters,
``` | metadata = config['data']['attributes']['metadata']
return {
'id': metadata['providerId'],
'webpage_url': traverse_obj(metadata, ('link', 'url')),
'title': traverse_obj(metadata, 'subtitle', 'title'),
'alt_title': metadata.get('subtitle') and metadata.get... | @@ -205,6 +224,7 @@ def _real_extract(self, url):
{'url': image['url'], 'id': image.get('caption')}
for image in metadata.get('images') or [] if url_or_none(image.get('url'))
],
+ 'chapters': chapters or None | yt_dlp/extractor/arte.py | 26 | Python | 0.571 | suggestion | 53 | 51 | 51 | false | [ArteTV] extract chapters | 5,879 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | iw0nderhow |
secondary_formats.extend(fmts)
else:
formats.extend(fmts)
self._merge_subtitles(subs, target=subtitles)
elif stream['protocol'] in ('HTTPS', 'RTMP'):
formats.append({
'format_id': f'{stream["protocol... | branching with traverse_obj (`...`) will always return a list
```suggestion
for chapter in traverse_obj(config, ('data', 'attributes', 'chapters', 'elements', ...)):
``` | else:
formats.extend(fmts)
self._merge_subtitles(subs, target=subtitles)
elif stream['protocol'] in ('HTTPS', 'RTMP'):
formats.append({
'format_id': f'{stream["protocol"]}-{stream_version_code}',
'ur... | @@ -181,13 +197,20 @@ def _real_extract(self, url):
self.report_warning(f'Skipping stream with unknown protocol {stream["protocol"]}')
# TODO: chapters from stream['segments']?
- # The JS also looks for chapters in config['data']['attributes']['chapters'],
- # but I... | yt_dlp/extractor/arte.py | 26 | Python | 0.714 | suggestion | 180 | 51 | 51 | false | [ArteTV] extract chapters | 5,879 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | iw0nderhow |
for chapter in traverse_obj(config, ('data', 'attributes', 'chapters', 'elements'),
expected_type=list) or []:
cue = int_or_none(chapter.get('startTime'))
if cue is not None:
chapters.append({
'start_time': cue,
... | you were right to do this originally, since not every video has chapters. then you can remove `chapters: []` from the first two tests. my bad
```suggestion
'chapters': chapters or None,
``` | 'webpage_url': traverse_obj(metadata, ('link', 'url')),
'title': traverse_obj(metadata, 'subtitle', 'title'),
'alt_title': metadata.get('subtitle') and metadata.get('title'),
'description': metadata.get('description'),
'duration': traverse_obj(metadata, ('dura... | @@ -205,6 +228,7 @@ def _real_extract(self, url):
{'url': image['url'], 'id': image.get('caption')}
for image in metadata.get('images') or [] if url_or_none(image.get('url'))
],
+ 'chapters': chapters, | yt_dlp/extractor/arte.py | 26 | Python | 0.857 | suggestion | 204 | 51 | 51 | false | [ArteTV] extract chapters | 5,879 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | iw0nderhow |
import importlib
import importlib.abc
import importlib.machinery
import importlib.util
import inspect
import itertools
import os
import pkgutil
import sys
import traceback
import zipimport
from pathlib import Path
from zipfile import ZipFile
from .compat import functools # isort: split
from .compat import compat_expa... | keeping this private for time-being as likely would change in the future.
any ideas for better location or solution? | import importlib
import importlib.abc
import importlib.machinery
import importlib.util
import inspect
import itertools
import os
import pkgutil
import sys
import traceback
import zipimport
from pathlib import Path
from zipfile import ZipFile
from .compat import functools # isort: split
from .compat import compat_expa... | @@ -24,6 +24,7 @@
PACKAGE_NAME = 'yt_dlp_plugins'
COMPAT_PACKAGE_NAME = 'ytdlp_plugins'
+_EXTRACTOR_PLUGIN_OVERRIDES = [] | yt_dlp/plugins.py | 26 | Python | 0.429 | question | 120 | 51 | 51 | false | Misc. plugin improvements | 5,916 | yt-dlp/yt-dlp | 132,642 | Python | coletdjnz | coletdjnz |
# The code is left like this to be reused for future deprecations
MIN_SUPPORTED, MIN_RECOMMENDED = (3, 7), (3, 7)
current_version = sys.version_info[:2]
if current_version < MIN_RECOMMENDED:
msg = ('Support for Python version %d.%d has been deprecated. '
'... | This isnt needed imo. The security risk is because servers may allow users to pass arbitrary URLs to yt-dlp. If the server allows arbitrary options, there are other options (like `--exec`) which are far more concerning |
# The code is left like this to be reused for future deprecations
MIN_SUPPORTED, MIN_RECOMMENDED = (3, 7), (3, 7)
current_version = sys.version_info[:2]
if current_version < MIN_RECOMMENDED:
msg = ('Support for Python version %d.%d has been deprecated. '
'... | @@ -618,6 +619,12 @@ def __init__(self, params=None, auto_init=True):
' If you experience any issues while using this option, '
f'{self._format_err("DO NOT", self.Styles.ERROR)} open a bug report')
+ if self.params.get('enable_file_urls'):
+ self.report_warn... | yt_dlp/YoutubeDL.py | 26 | Python | 0.786 | security | 218 | 51 | 51 | false | Add `--enable-file-urls` | 5,917 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | coletdjnz |
return [self.url_result(new_url)]
else:
found = None
if not found:
# twitter:player is a https URL to iframe player that may or may not
# be supported by yt-dlp thus this is checked the very last (see
# https://dev.twit... | should this be part of `unescapeHTML`? | found = re.search(REDIRECT_REGEX, refresh_header)
if found:
new_url = urllib.parse.urljoin(url, unescapeHTML(found.group(1)))
if new_url != url:
self.report_following_redirect(new_url)
return [self.url_result(new_url... | @@ -2748,6 +2763,7 @@ def filter_video(urls):
entries = []
for video_url in orderedSet(found):
+ video_url = video_url.encode().decode('unicode-escape') | yt_dlp/extractor/generic.py | 26 | Python | 0.286 | security | 38 | 51 | 51 | false | [extractor/generic] Decode unicode-escaped embed URLs | 5,919 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
};
var enc_params = [];
for (var prop in query) {
enc_params.push(encodeURIComponent(prop) + '=' + encodeURIComponent(query[prop]));
}
ut_list.forEach(function(ut) {
enc_params.push('ut=' + ut);
... | ```suggestion
webpack_map = self._parse_json(self._search_regex(
r'["\']\s*\+\s*(\{\s*(?:\d+\s*:\s*["\'][\da-f]+["\']\s*,?\s*)+})\[\w+\]\+["\']\.js',
webpack_js, 'JS locations'), video_id, transform_source=js_to_json)
```
See if you can use `self._search_json`. It's a bit more rob... | };
var enc_params = [];
for (var prop in query) {
enc_params.push(encodeURIComponent(prop) + '=' + encodeURIComponent(query[prop]));
}
ut_list.forEach(function(ut) {
enc_params.push('ut=' + ut);
... | @@ -527,11 +527,13 @@ def _extract_vms_player_js(self, webpage, video_id):
webpack_js_url = self._proto_relative_url(self._search_regex(
r'<script src="((?:https?)?//stc.iqiyipic.com/_next/static/chunks/webpack-\w+\.js)"', webpage, 'webpack URL'))
webpack_js = self._download_webpage(webpa... | yt_dlp/extractor/iqiyi.py | 26 | Python | 0.857 | suggestion | 366 | 51 | 51 | false | [extractor/iqiyi] Fix `Iq` JS regex | 5,922 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
for (var prop in query) {
enc_params.push(encodeURIComponent(prop) + '=' + encodeURIComponent(query[prop]));
}
ut_list.forEach(function(ut) {
enc_params.push('ut=' + ut);
})
var dash_path = '/dash?' +... | ```suggestion
for module_index in reversed(webpack_map):
```
dicts are reversible | for (var prop in query) {
enc_params.push(encodeURIComponent(prop) + '=' + encodeURIComponent(query[prop]));
}
ut_list.forEach(function(ut) {
enc_params.push('ut=' + ut);
})
var dash_path = '/dash?' +... | @@ -527,11 +527,13 @@ def _extract_vms_player_js(self, webpage, video_id):
webpack_js_url = self._proto_relative_url(self._search_regex(
r'<script src="((?:https?)?//stc.iqiyipic.com/_next/static/chunks/webpack-\w+\.js)"', webpage, 'webpack URL'))
webpack_js = self._download_webpage(webpa... | yt_dlp/extractor/iqiyi.py | 26 | Python | 0.571 | suggestion | 92 | 51 | 51 | false | [extractor/iqiyi] Fix `Iq` JS regex | 5,922 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | bashonly |
}, {
'url': 'https://91porn.com/view_video.php?viewkey=726186267387ffe1e5e6',
'md5': 'b0067d158495566fe3d20bafd89e36d1',
'info_dict': {
'id': '726186267387ffe1e5e6',
'title': '见过卖老婆的,那你见过卖亲闺女的吗?',
'ext': 'mp4',
'duration': 244,
'com... | This string could actually be in the title too, no? Use `remove_end` to be reliable | 'ext': 'mp4',
'duration': 248,
'upload_date': '20221119',
'comment_count': int,
'view_count': int,
'age_limit': 18,
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'l... | @@ -33,28 +59,29 @@ def _real_extract(self, url):
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
title = self._search_regex(
- r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
- title = title.replace('\n', '')
+ r'<ti... | yt_dlp/extractor/porn91.py | 26 | Python | 0.429 | suggestion | 83 | 51 | 51 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
'info_dict': {
'id': '726186267387ffe1e5e6',
'title': '见过卖老婆的,那你见过卖亲闺女的吗?',
'ext': 'mp4',
'duration': 244,
'comment_count': int,
'age_limit': 18,
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
... | ```suggestion
r'document\.write\(\s*strencode2\s*\(\s*((?:"[^"]+\")|(?:\'[^\']+\'))\s*\)\s*\)',
```
`\s*;?` does nothing here | 'comment_count': int,
'view_count': int,
'age_limit': 18,
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(
'http://91porn.com/v... | @@ -33,28 +59,29 @@ def _real_extract(self, url):
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
title = self._search_regex(
- r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
- title = title.replace('\n', '')
+ r'<ti... | yt_dlp/extractor/porn91.py | 26 | Python | 0.714 | suggestion | 140 | 48 | 51 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
'comment_count': int,
'age_limit': 18,
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % vid... | ```suggestion
video_link_url = self._search_regex(
r"src=\'([^\']+)\'", urllib.parse.unquote(video_link_url), 'unquoted video link')
``` |
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
if '视频不存在,可能已经被删除或者被举报为不良内容!' in webpage:
... | @@ -33,28 +59,29 @@ def _real_extract(self, url):
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
title = self._search_regex(
- r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
- title = title.replace('\n', '')
+ r'<ti... | yt_dlp/extractor/porn91.py | 26 | Python | 0.714 | suggestion | 159 | 43 | 51 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
if '作为游客,你每天只可观看10个视频' in webpage:
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
title = self._html_extract_title(webpage)
... | This is incorrect as well I think. There are some examples of `video_link_url` with `m3u8` extension. I'm looking at `_parse_html5_media_entries` to fill in the value unless there is something easier. |
if '视频不存在,可能已经被删除或者被举报为不良内容!' in webpage:
raise ExtractorError('91 Porn says: Video does not exist', expected=True)
daily_limit = self._search_regex(
r'作为游客,你每天只可观看([\d]+)个视频', webpage, 'exceeded daily limit', default=None, fatal=False)
if daily_limit:
raise... | @@ -32,29 +57,27 @@ def _real_extract(self, url):
if '作为游客,你每天只可观看10个视频' in webpage:
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
- title = self._search_regex(
- r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
- title ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.571 | bug | 200 | 32 | 44 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pmitchell86 | pmitchell86 |
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
if '作为游客,你每天只可观看10个视频' in webpage:
raise E... | ```suggestion
description = self._html_search_regex(
r'<span\s+class=["\']more title["\']>([^<]+)<br', webpage, 'description', fatal=False)
```
You realize the .strip negates the whole point of fatal=False, right? | raise ExtractorError(f'91 Porn says: Daily limit {daily_limit} videos exceeded', expected=True)
video_link_url = self._search_regex(
r'document\.write\(\s*strencode2\s*\(\s*((?:"[^"]+")|(?:\'[^\']+\'))', webpage, 'video link')
video_link_url = self._search_regex(
r's... | @@ -32,29 +68,40 @@ def _real_extract(self, url):
if '作为游客,你每天只可观看10个视频' in webpage:
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
- title = self._search_regex(
- r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
- title ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.786 | question | 237 | 49 | 37 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
'duration': 244,
'release_date': '20221231',
'comment_count': int,
'view_count': int,
'age_limit': 18,
}
}]
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
... | ```suggestion
r'src=["\']([^\'"]+)["\']', urllib.parse.unquote(video_link_url), 'unquoted video link')
``` |
if '视频不存在,可能已经被删除或者被举报为不良内容!' in webpage:
raise ExtractorError('91 Porn says: Video does not exist', expected=True)
daily_limit = self._search_regex(
r'作为游客,你每天只可观看([\d]+)个视频', webpage, 'exceeded daily limit', default=None, fatal=False)
if daily_limit:
raise... | @@ -32,29 +68,40 @@ def _real_extract(self, url):
if '作为游客,你每天只可观看10个视频' in webpage:
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
- title = self._search_regex(
- r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
- title ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.714 | suggestion | 120 | 51 | 44 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
webpage, 'video link')
video_link_url = self._search_regex(
r"src=\'([^\']+)\'", urllib.parse.unquote(video_link_url), 'unquoted video link')
release_date = self._search_regex(
r'<span\s+class=["\']title-yakov["\']>(\d{4}-\d{2}-\d{2})</span>', webpage, 'timestamp', f... | You sure this shouldn't be `upload_date`? | import urllib.parse
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_duration,
remove_end,
unified_strdate,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/view_video.php\?([^... | @@ -32,29 +68,40 @@ def _real_extract(self, url):
if '作为游客,你每天只可观看10个视频' in webpage:
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
- title = self._search_regex(
- r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
- title ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.286 | question | 41 | 33 | 96 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
'age_limit': 18,
}
}, {
'url': 'https://91porn.com/view_video.php?viewkey=726186267387ffe1e5e6',
'md5': 'b0067d158495566fe3d20bafd89e36d1',
'info_dict': {
'id': '726186267387ffe1e5e6',
'title': '见过卖老婆的,那你见过卖亲闺女的吗?',
'description': '疫情当下... | Why not use regex to extract out the number? | 'age_limit': 18,
}
}, {
'url': 'https://91porn.com/view_video.php?viewkey=7ef0cf3d362c699ab91c',
'md5': 'f8fd50540468a6d795378cd778b40226',
'info_dict': {
'id': '7ef0cf3d362c699ab91c',
'title': '真实空乘,冲上云霄第二部',
'description': 'md5:618bf9... | @@ -29,32 +51,42 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
- if '作为游客,你每天只可观看10个视频' in webpage:
- raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
+ ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.143 | refactor | 44 | 51 | 51 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
'title': '见过卖老婆的,那你见过卖亲闺女的吗?',
'description': '疫情当下,如何约炮?\n--19kn.cc--\n拥有全国线下学生、少妇、反差婊、兼职良家。\n并且免费!!!\n只需要一个电话,一个定位,就能送炮上门。可提前查看照片\n(妹子自带48小时核酸报告)\n约炮,我们是认真的!\n并且拥有三大优势!\n\n1、各种求包养母狗,学生妹资源。为你解决各种需要。--19kn.cc--\n\n2、所有女性会员经过实名视频验证,平台严选,杜绝各种骗红包,口嗨者。--19kn.cc--\n\n3、5年大平台,91许多约炮案例,包括知名博主女伴,均是我们撮合成... | ```suggestion
r'document\.write\(\s*strencode2\s*\(\s*((?:"[^"]+")|(?:\'[^\']+\'))', webpage, 'video link')
``` | 'title': '真实空乘,冲上云霄第二部',
'description': 'md5:618bf9652cafcc66cd277bd96789baea',
'ext': 'mp4',
'duration': 248,
'upload_date': '20221119',
'comment_count': int,
'view_count': int,
'age_limit': 18,
}
}]
def _r... | @@ -29,32 +51,42 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
- if '作为游客,你每天只可观看10个视频' in webpage:
- raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
+ ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.714 | suggestion | 125 | 51 | 51 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
r'document\.write\(\s*strencode2\s*\(\s*((?:"[^"]+")|(?:\'[^\']+\'))\s*\)\s*\)', webpage, 'video link')
video_link_url = self._search_regex(
r'src=["\']([^"\']+)["\']', urllib.parse.unquote(video_link_url), 'unquoted video link')
upload_date = self._search_regex(
r'<... | ```suggestion
'upload_date': unified_strdate(self._search_regex(
r'<span\s+class=["\']title-yakov["\']>(\d{4}-\d{2}-\d{2})</span>',
webpage, 'upload_date', fatal=False)),
```
etc |
video_link_url = self._search_regex(
r'document\.write\(\s*strencode2\s*\(\s*((?:"[^"]+")|(?:\'[^\']+\'))', webpage, 'video link')
video_link_url = self._search_regex(
r'src=["\']([^"\']+)["\']', urllib.parse.unquote(video_link_url), 'unquoted video link')
formats, subt... | @@ -29,32 +51,42 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
- if '作为游客,你每天只可观看10个视频' in webpage:
- raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
+ ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.786 | suggestion | 227 | 33 | 36 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
if '作为游客,你每天只可观看15个视频' in webpage:
raise ExtractorError('91 Porn says: Daily ... | ```suggestion
r'时长:\s*<span[^>]*>\s*(\d+(?::\d+){1,2})', webpage, 'duration', fatal=False))
```
* `{1,2}` to support old format too
* Is `</span>` needed? | video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
if '视频不存在,可能已经被删除或者被举报为不良内容!' in webpage:
raise ExtractorError('91 Porn says:... | @@ -29,32 +51,42 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
- if '作为游客,你每天只可观看10个视频' in webpage:
- raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
+ ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.714 | question | 170 | 46 | 49 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
}]
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
if '作为游客,你每天只可观看15个视频' in webpage:
... | The regex is wrong. You have to group the `.` with `(?!)` and `*` the whole thing to do what you want. But it's better to just do:
```suggestion
r'<span\s+class=["\']more title["\']>\s*([^<]+', webpage, 'description', fatal=False)
``` | }]
def _real_extract(self, url):
video_id = self._match_id(url)
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
if '视频不存在,可能已经被删除或者被举报为不良内容!' in webpage:
... | @@ -29,32 +51,42 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
- if '作为游客,你每天只可观看10个视频' in webpage:
- raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
+ ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.857 | bug | 249 | 49 | 51 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
video_link_url = self._search_regex(
r'document\.write\(\s*strencode2\s*\(\s*((?:"[^"]+")|(?:\'[^\']+\'))\s*\)\s*\)', webpage, 'video link')
video_link_url = self._search_regex(
r'src=["\']([^"\']+)["\']', urllib.parse.unquote(video_link_url), 'unquoted video link')
upl... | ```suggestion
```
Unnecessary | if daily_limit:
raise ExtractorError(f'91 Porn says: Daily limit {daily_limit} videos exceeded', expected=True)
video_link_url = self._search_regex(
r'document\.write\(\s*strencode2\s*\(\s*((?:"[^"]+")|(?:\'[^\']+\'))', webpage, 'video link')
video_link_url = self._searc... | @@ -29,32 +51,42 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
- if '作为游客,你每天只可观看10个视频' in webpage:
- raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
+ ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.429 | suggestion | 31 | 35 | 38 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/.*([\?&])viewkey=(?P<id>[\w\d]+)'
_TESTS = [{
'url': 'http://91porn.com/view_video.php?viewkey=7e42283b4f5ab36da134',
'md5': 'd869db281402e0ef4ddef3c38b866f86',
'info_dict': {
... | Wrong. Either test def is wrong, or you need to use `_extract_m3u8_formats_and_subtitles` in code | class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/view_video.php\?([^#]+&)?viewkey=(?P<id>\w+)'
_TESTS = [{
'url': 'http://91porn.com/view_video.php?viewkey=7e42283b4f5ab36da134',
'md5': 'd869db281402e0ef4ddef3c38b866f86',
'info_dict... | @@ -1,26 +1,48 @@
+import urllib.parse
from .common import InfoExtractor
from ..utils import (
- parse_duration,
+ determine_ext,
int_or_none,
+ parse_duration,
+ remove_end,
+ unified_strdate,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
- _VALID_URL = r'... | yt_dlp/extractor/porn91.py | 26 | Python | 0.429 | bug | 97 | 51 | 51 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
import urllib.parse
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_duration,
remove_end,
unified_strdate,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/.*([\?&])viewkey=(?... | ```suggestion
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/view_video.php\?([^#]+&)?viewkey=(?P<id>\w+)'
``` | import urllib.parse
from .common import InfoExtractor
from ..utils import (
determine_ext,
int_or_none,
parse_duration,
remove_end,
unified_strdate,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
_VALID_URL = r'(?:https?://)(?:www\.|)91porn\.com/view_video.php\?([^... | @@ -1,26 +1,48 @@
+import urllib.parse
from .common import InfoExtractor
from ..utils import (
- parse_duration,
+ determine_ext,
int_or_none,
+ parse_duration,
+ remove_end,
+ unified_strdate,
ExtractorError,
)
class Porn91IE(InfoExtractor):
IE_NAME = '91porn'
- _VALID_URL = r'... | yt_dlp/extractor/porn91.py | 15 | Python | 0.714 | suggestion | 119 | 40 | 40 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
formats, subtitles = self._get_formats_and_subtitle(video_link_url, video_id)
return {
'id': video_id,
'url': video_link_url,
'title': remove_end(self._html_extract_title(webpage).replace('\n', ''), 'Chinese homemade video').strip(),
'formats': formats,
... | ```suggestion
formats, subtitles = self._extract_m3u8_formats_and_subtitles(video_link_url, video_id, ext='mp4')
```
This should fix any issues you are having with ext | formats, subtitles = self._get_formats_and_subtitle(video_link_url, video_id)
return {
'id': video_id,
'title': remove_end(self._html_extract_title(webpage).replace('\n', ''), 'Chinese homemade video').strip(),
'formats': formats,
'subtitles': subtitles,
... | @@ -29,32 +51,47 @@ def _real_extract(self, url):
webpage = self._download_webpage(
'http://91porn.com/view_video.php?viewkey=%s' % video_id, video_id)
- if '作为游客,你每天只可观看10个视频' in webpage:
- raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
+ ... | yt_dlp/extractor/porn91.py | 26 | Python | 0.786 | refactor | 182 | 32 | 30 | false | [91porn] fix title & comment extraction | 5,932 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | pmitchell86 |
_VALID_URL = r'https?://volej\.tv/video/(?P<id>\d+)'
_TESTS = [{
'url': 'https://volej.tv/video/725742/',
'info_dict': {
'id': '725742',
'ext': 'mp4',
'description': 'Zápas VK Královo Pole vs VK Prostějov 10.12.2022 v 19:00 na Volej.TV',
'thumbnail... | ```suggestion
r'<\s*!\[CDATA[^=]+=', webpage, 'CDATA', video_id)
``` | _VALID_URL = r'https?://volej\.tv/video/(?P<id>\d+)'
_TESTS = [{
'url': 'https://volej.tv/video/725742/',
'info_dict': {
'id': '725742',
'ext': 'mp4',
'description': 'Zápas VK Královo Pole vs VK Prostějov 10.12.2022 v 19:00 na Volej.TV',
'thumbnail... | @@ -0,0 +1,40 @@
+from .common import InfoExtractor
+
+
+class VolejTVIE(InfoExtractor):
+ _VALID_URL = r'https?://volej\.tv/video/(?P<id>\d+)'
+ _TESTS = [{
+ 'url': 'https://volej.tv/video/725742/',
+ 'info_dict': {
+ 'id': '725742',
+ 'ext': 'mp4',
+ 'description'... | yt_dlp/extractor/volejtv.py | 26 | Python | 0.571 | suggestion | 82 | 37 | 37 | false | [extractor/volejtv] Add extractor | 5,943 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
from .common import InfoExtractor
from .dailymotion import DailymotionIE
from .youtube import YoutubeIE
class GMANetworkVideoIE(InfoExtractor):
_VALID_URL = r'https?://www\.gmanetwork\.com/\w+/\w+/\w+/(?P<id>\d+)/(?P<display_id>[\w-]+)/video'
_TESTS = [{
'url': 'https://www.gmanetwork.com/fullepisodes... | ```suggestion
_VALID_URL = r'https?://(?:www\.)gmanetwork\.com/(?:\w+/){3}(?P<id>\d+)/(?P<display_id>[\w-]+)/video'
``` | from .common import InfoExtractor
from .dailymotion import DailymotionIE
from .youtube import YoutubeIE
class GMANetworkVideoIE(InfoExtractor):
_VALID_URL = r'https?://(?:www)\.gmanetwork\.com/(?:\w+/){3}(?P<id>\d+)/(?P<display_id>[\w-]+)/video'
_TESTS = [{
'url': 'https://www.gmanetwork.com/fullepiso... | @@ -0,0 +1,83 @@
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from .youtube import YoutubeIE
+
+
+class GMANetworkVideoIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.gmanetwork\.com/\w+/\w+/\w+/(?P<id>\d+)/(?P<display_id>[\w-]+)/video' | yt_dlp/extractor/gmanetwork.py | 7 | Python | 0.714 | suggestion | 125 | 32 | 32 | false | [extractor/gmanetwork] Add extractor | 5,945 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'uploader_id': 'GMANETWORK',
'categories': ['Entertainment'],
'uploader': 'GMANetwork',
'channel_url': 'https://www.youtube.com/channel/UCKL5hAuzgFQsyrsQKgU0Qng',
'tags': 'count:29',
'view_count': int,
'uploader_url': 'http://www.youtub... | ```suggestion
if json_data.get('video_id'):
return self.url_result(json_data['video_file'], YoutubeIE, json_data['video_id'])
``` | 'uploader_id': 'GMANETWORK',
'categories': ['Entertainment'],
'uploader': 'GMANetwork',
'channel_url': 'https://www.youtube.com/channel/UCKL5hAuzgFQsyrsQKgU0Qng',
'tags': 'count:29',
'view_count': int,
'uploader_url': 'http://www.youtub... | @@ -0,0 +1,83 @@
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from .youtube import YoutubeIE
+
+
+class GMANetworkVideoIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.gmanetwork\.com/\w+/\w+/\w+/(?P<id>\d+)/(?P<display_id>[\w-]+)/video'
+ _TESTS = [{
+ 'url': 'https://www.g... | yt_dlp/extractor/gmanetwork.py | 26 | Python | 0.714 | suggestion | 152 | 29 | 29 | false | [extractor/gmanetwork] Add extractor | 5,945 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'age_limit': 0,
'comment_count': int,
'upload_date': '20181003',
'thumbnail': 'https://i.ytimg.com/vi_webp/yiDOExw2aSA/maxresdefault.webp',
'availability': 'public',
'playable_in_embed': True,
'channel_id': 'UCKL5hAuzgFQsyrsQKgU0Qng',
... | ```suggestion
return self.url_result(youtube_id, YoutubeIE, youtube_id)
``` | 'age_limit': 0,
'comment_count': int,
'upload_date': '20181003',
'thumbnail': 'https://i.ytimg.com/vi_webp/yiDOExw2aSA/maxresdefault.webp',
'availability': 'public',
'playable_in_embed': True,
'channel_id': 'UCKL5hAuzgFQsyrsQKgU0Qng',
... | @@ -0,0 +1,83 @@
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from .youtube import YoutubeIE
+
+
+class GMANetworkVideoIE(InfoExtractor):
+ _VALID_URL = r'https?://www\.gmanetwork\.com/\w+/\w+/\w+/(?P<id>\d+)/(?P<display_id>[\w-]+)/video'
+ _TESTS = [{
+ 'url': 'https://www.g... | yt_dlp/extractor/gmanetwork.py | 26 | Python | 0.571 | suggestion | 89 | 37 | 37 | false | [extractor/gmanetwork] Add extractor | 5,945 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | HobbyistDev |
'description': 'md5:6d00cd658394fa1a5071200d3ed4be05',
'duration': 1419,
'age_limit': 0,
'comment_count': int,
'upload_date': '20181003',
'thumbnail': 'https://i.ytimg.com/vi_webp/yiDOExw2aSA/maxresdefault.webp',
'availability': 'public... | regex fix + this should be non-fatal if we want to be able to use the API call route
```suggestion
youtube_id = self._search_regex(
r'var\s*YOUTUBE_VIDEO\s*=\s*[\'"]+(?P<yt_id>[\w-]+)', webpage, 'youtube_id', fatal=False)
``` | 'description': 'md5:6d00cd658394fa1a5071200d3ed4be05',
'duration': 1419,
'age_limit': 0,
'comment_count': int,
'upload_date': '20181003',
'thumbnail': 'https://i.ytimg.com/vi_webp/yiDOExw2aSA/maxresdefault.webp',
'availability': 'public... | @@ -0,0 +1,83 @@
+from .common import InfoExtractor
+from .dailymotion import DailymotionIE
+from .youtube import YoutubeIE
+
+
+class GMANetworkVideoIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www)\.gmanetwork\.com/(?:\w+/){3}(?P<id>\d+)/(?P<display_id>[\w-]+)/video'
+ _TESTS = [{
+ 'url': 'https://ww... | yt_dlp/extractor/gmanetwork.py | 26 | Python | 0.857 | suggestion | 249 | 39 | 39 | false | [extractor/gmanetwork] Add extractor | 5,945 | yt-dlp/yt-dlp | 132,642 | Python | bashonly | HobbyistDev |
@classmethod
def suitable(cls, url):
return False if PolskieRadioLegacyIE.suitable(url) else super().suitable(url)
def _entries(self, url, page, category_id):
content = page
is_billennium_tabs = 'onclick="TB_LoadTab(' in page
is_post_back = 'onclick="__doPostBack(' in page
... | ```suggestion
'id': media['uid'],
```
id cant be None | 'id': '214',
'title': 'Muzyka',
},
'playlist_mincount': 61
}, {
# billennium tabs
'url': 'https://www.polskieradio.pl/8/2385',
'info_dict': {
'id': '2385',
'title': 'Droga przez mąkę',
},
'playlist_mincount': 111... | @@ -322,22 +353,74 @@ def _entries(self, url, page, category_id):
yield self.url_result(
compat_urlparse.urljoin(url, href), PolskieRadioLegacyIE,
entry_id, entry.get('title'))
- mobj = re.search(
- r'<div[^>]+class=["\']next["\'][^>]*... | yt_dlp/extractor/polskieradio.py | 26 | Python | 0.571 | suggestion | 76 | 51 | 51 | false | [polskieradio] category fixes, tag support | 5,948 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | selfisekai |
if is_billennium_tabs:
mobj = re.search(
r'<div[^>]+class=["\']next["\'][^>]*>\s*<a[^>]+onclick=(["\'])TB_LoadTab\((?P<params>(?:(?!\1).)+)\);\1',
pagination)
if not mobj:
break
params = self._parse_j... | ```suggestion
tab_content = self._download_json(
'https://www.polskieradio.pl/CMS/TemplateBoxesManagement/TemplateBoxTabContent.aspx/GetTabContent',
category_id, f'Downloading page {page_num}',
headers={'content-type': 'application/json'}, ... | 'id': '175458',
'title': 'Krzysztof Dziuba',
},
'playlist_mincount': 420,
}, {
'url': 'http://www.polskieradio.pl/8,Dwojka/196,Publicystyka',
'only_matching': True,
}]
@classmethod
def suitable(cls, url):
return False if PolskieRadioLegacy... | @@ -322,22 +353,74 @@ def _entries(self, url, page, category_id):
yield self.url_result(
compat_urlparse.urljoin(url, href), PolskieRadioLegacyIE,
entry_id, entry.get('title'))
- mobj = re.search(
- r'<div[^>]+class=["\']next["\'][^>]*... | yt_dlp/extractor/polskieradio.py | 26 | Python | 0.929 | suggestion | 842 | 51 | 51 | false | [polskieradio] category fixes, tag support | 5,948 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | selfisekai |
'maxDocumentAge': params[12],
'showCategoryForArticle': params[13],
}).encode('utf-8'), headers={'content-type': 'application/json'})
content = tab_content['d']['Content']
pagination = tab_content['d']['PagerContent']
... | ```py
next_url = urljoin(url, self._search_regex(...))
```
Use the `urljoin` in utils | if entry.get('href'):
yield self.url_result(
urljoin(url, entry['href']), PolskieRadioLegacyIE, entry_id, entry.get('title'))
for a_entry in re.findall(r'<span data-media=({[^ ]+})', content):
yield traverse_obj(self._parse_json(a_e... | @@ -322,22 +353,74 @@ def _entries(self, url, page, category_id):
yield self.url_result(
compat_urlparse.urljoin(url, href), PolskieRadioLegacyIE,
entry_id, entry.get('title'))
- mobj = re.search(
- r'<div[^>]+class=["\']next["\'][^>]*... | yt_dlp/extractor/polskieradio.py | 26 | Python | 0.786 | suggestion | 104 | 51 | 51 | false | [polskieradio] category fixes, tag support | 5,948 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | selfisekai |
r'<div[^>]+class=["\']next["\'][^>]*>\s*<a[^>]+onclick=(["\'])TB_LoadTab\((?P<params>(?:(?!\1).)+)\);\1',
pagination)
if not mobj:
break
params = self._parse_json('[' + js_to_json(unescapeHTML(mobj.group('params'))) + ']', categ... | pagination should be non-fatal, no? | },
'playlist_mincount': 420,
}, {
'url': 'http://www.polskieradio.pl/8,Dwojka/196,Publicystyka',
'only_matching': True,
}]
@classmethod
def suitable(cls, url):
return False if PolskieRadioLegacyIE.suitable(url) else super().suitable(url)
def _entries(self, u... | @@ -322,22 +353,74 @@ def _entries(self, url, page, category_id):
yield self.url_result(
compat_urlparse.urljoin(url, href), PolskieRadioLegacyIE,
entry_id, entry.get('title'))
- mobj = re.search(
- r'<div[^>]+class=["\']next["\'][^>]*... | yt_dlp/extractor/polskieradio.py | 26 | Python | 0.143 | question | 35 | 51 | 51 | false | [polskieradio] category fixes, tag support | 5,948 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | selfisekai |
if entry.get('href'):
yield self.url_result(
urljoin(url, entry['href']), PolskieRadioLegacyIE, entry_id, entry.get('title'))
for a_entry in re.findall(r'<span data-media=({[^ ]+})', content):
yield traverse_obj(self._parse_json(a_e... | ```suggestion
), params))).encode())['d']
``` | }, {
'url': 'https://www.polskieradio.pl/10/4930',
'info_dict': {
'id': '4930',
'title': 'Teraz K-pop!',
},
'playlist_mincount': 392,
}, {
# post back pages, audio content directly without articles
'url': 'https://www.polskieradio.pl/8,dwoj... | @@ -311,33 +336,69 @@ def suitable(cls, url):
def _entries(self, url, page, category_id):
content = page
+ is_billennium_tabs = 'onclick="TB_LoadTab(' in page
+ is_post_back = 'onclick="__doPostBack(' in page
+ pagination = page if is_billennium_tabs else None
for page_num ... | yt_dlp/extractor/polskieradio.py | 26 | Python | 0.571 | suggestion | 67 | 51 | 51 | false | [polskieradio] category fixes, tag support | 5,948 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | selfisekai |
'otype': 'json',
'spwm': '1',
# For SHD
'host': self._HOST,
'referer': self._REFERER,
'ehost': video_url,
'appVer': self._APP_VERSION,
'platform': self._PLATFORM,
# For VQQ
'guid': guid,
'... | Avoid declaring variables only used once
https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#inline-values | query = {
'vid': video_id,
'cid': series_id,
'cKey': ckey,
'encryptVer': '8.1',
'spcaptiontype': '1' if subtitle_format == 'vtt' else '0',
'sphls': '2' if video_format == 'hls' else '0',
'dtype': '3' if video_format == 'hls' els... | @@ -63,7 +70,9 @@ def _get_video_api_response(self, video_url, video_id, series_id, subtitle_forma
def _extract_video_formats_and_subtitles(self, api_response, video_id):
video_response = api_response['vl']['vi'][0]
- video_width, video_height = video_response.get('vw'), video_response.get('vh')
... | yt_dlp/extractor/tencent.py | 26 | Python | 0.429 | suggestion | 118 | 51 | 51 | false | [extractor/tencent]: Add more formats and info | 5,950 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | Hill-98 |
# For SHD
'host': self._HOST,
'referer': self._REFERER,
'ehost': video_url,
'appVer': self._APP_VERSION,
'platform': self._PLATFORM,
# For VQQ
'guid': guid,
'flowid': ''.join(random.choices(string.digits + string... | This will fail if the field doesn't exist, use instead `float_or_none(format_response.get('audiobandwidth'), scale=1000)`
https://github.com/yt-dlp/yt-dlp/blob/master/CONTRIBUTING.md#mandatory-and-optional-metafields
```bash
[debug] Command-line config: ['https://wetv.vip/en/play/7csb8h9c79p8idi-Lie%20To%20Love'... | 'cid': series_id,
'cKey': ckey,
'encryptVer': '8.1',
'spcaptiontype': '1' if subtitle_format == 'vtt' else '0',
'sphls': '2' if video_format == 'hls' else '0',
'dtype': '3' if video_format == 'hls' else '0',
'defn': video_quality,
... | @@ -63,7 +70,9 @@ def _get_video_api_response(self, video_url, video_id, series_id, subtitle_forma
def _extract_video_formats_and_subtitles(self, api_response, video_id):
video_response = api_response['vl']['vi'][0]
- video_width, video_height = video_response.get('vw'), video_response.get('vh')
... | yt_dlp/extractor/tencent.py | 26 | Python | 1 | bug | 3,040 | 51 | 51 | false | [extractor/tencent]: Add more formats and info | 5,950 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | Hill-98 |
return subtitles
def _extract_all_video_formats_and_subtitles(self, url, video_id, series_id):
formats, subtitles = [], {}
for video_format, subtitle_format, video_quality in (
# '': 480p, 'shd': 720p, 'fhd': 1080p
('mp4', 'srt', ''), ('hls', 'vtt', 'shd'), (... | I remember only extracting 480p, 720p and 1080p because doing so many requests will get you blocked.
If you really want all formats, maybe we can add an extractor argument for this? Not all videos have 4k and I think it's not worth it getting blocked. | identifier = video_response.get('br')
format_response = traverse_obj(
api_response, ('fl', 'fi', lambda _, v: v['br'] == identifier),
expected_type=dict, get_all=False) or {}
common_info = {
'width': video_response.get('vw'),
'height': video_respon... | @@ -100,8 +119,8 @@ def _extract_video_native_subtitles(self, api_response, subtitles_format):
def _extract_all_video_formats_and_subtitles(self, url, video_id, series_id):
formats, subtitles = [], {}
for video_format, subtitle_format, video_quality in (
- # '': 480p, 'shd': 720p, ... | yt_dlp/extractor/tencent.py | 26 | Python | 0.5 | refactor | 255 | 51 | 51 | false | [extractor/tencent]: Add more formats and info | 5,950 | yt-dlp/yt-dlp | 132,642 | Python | elyse0 | Hill-98 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.