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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
'rtmp://flash.npr.org/ondemand/', 'https://ondemand.npr.org/'),
fatal=False)
self._check_formats(smil_formats, media_id)
formats.extend(smil_formats)
else:
formats.appe... | ```suggestion
json_ld.get('embedUrl'), media_id, 'mp4',
``` | format_url, media_id, 'mp4', 'm3u8_native',
m3u8_id='hls', fatal=False))
elif format_id == 'smil':
smil_formats = self._extract_smil_formats(
format_url, media_id, transform_source=lambda s: s... | @@ -110,6 +118,13 @@ def _real_extract(self, url):
formats.extend(self._extract_m3u8_formats(
stream_url, stream_id, 'mp4', 'm3u8_native',
m3u8_id='hls', fatal=False))
+
+ if len(formats) == 0 and json_ld.get('embedUrl', None) is not None:
+ ... | yt_dlp/extractor/npr.py | 26 | Python | 0.571 | suggestion | 81 | 40 | 42 | false | [npr]: get stream url from json-ld | 3,455 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | r5d |
query_url = (
'https://www.khanacademy.org/api/internal/graphql/FetchContentData?fastly_cacheable='
+ fastly_cacheable
+ '&hash='
+ str(query_hash)
+ '&lang='
+ query_lang
+ '&variables=%7B%22path%22%3A%22'
+ display... | Use query parameter of _download_json | 'path': display_id,
'queryParams': 'lang=en',
'isModal': False,
'followRedirects': True,
'countryCode': 'US',
}),
})['data']['contentJson']
return self._parse_component_props(self._par... | @@ -25,15 +25,39 @@ def _parse_video(self, video):
def _real_extract(self, url):
display_id = self._match_id(url)
- component_props = self._parse_json(self._download_json(
- 'https://www.khanacademy.org/api/internal/graphql',
- display_id, query={
- 'hash': 16... | yt_dlp/extractor/khanacademy.py | 26 | Python | 0.143 | suggestion | 37 | 51 | 51 | false | [khan academy] Fix extractor | 3,462 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | rand-net |
return {
'_type': 'url_transparent',
'url': video['youtubeId'],
'id': video.get('slug'),
'title': video.get('title'),
'thumbnail': video.get('imageUrl') or video.get('thumbnailUrl'),
'duration': int_or_none(video.get('duration')),
... | ```py
'variables': json.dumps({
'path': display_id,
...,
}),
``` |
def _parse_video(self, video):
return {
'_type': 'url_transparent',
'url': video['youtubeId'],
'id': video.get('slug'),
'title': video.get('title'),
'thumbnail': video.get('imageUrl') or video.get('thumbnailUrl'),
'duration': int_or_no... | @@ -25,15 +23,23 @@ def _parse_video(self, video):
def _real_extract(self, url):
display_id = self._match_id(url)
- component_props = self._parse_json(self._download_json(
- 'https://www.khanacademy.org/api/internal/graphql',
- display_id, query={
- 'hash': 16... | yt_dlp/extractor/khanacademy.py | 26 | Python | 0.714 | suggestion | 157 | 51 | 51 | false | [khan academy] Fix extractor | 3,462 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | rand-net |
'thumbnail': video.get('imageUrl') or video.get('thumbnailUrl'),
'duration': int_or_none(video.get('duration')),
'description': video.get('description'),
'ie_key': 'Youtube',
}
def _real_extract(self, url):
display_id = self._match_id(url)
com... | ```py
content = self._download_json(
...)['data']['contentJson']
return self._parse_component_props(self._parse_json(content, display_id)['componentProps'])
``` | 'id': video.get('slug'),
'title': video.get('title'),
'thumbnail': video.get('imageUrl') or video.get('thumbnailUrl'),
'duration': int_or_none(video.get('duration')),
'description': video.get('description'),
'ie_key': 'Youtube',
}
def ... | @@ -25,15 +23,23 @@ def _parse_video(self, video):
def _real_extract(self, url):
display_id = self._match_id(url)
- component_props = self._parse_json(self._download_json(
- 'https://www.khanacademy.org/api/internal/graphql',
- display_id, query={
- 'hash': 16... | yt_dlp/extractor/khanacademy.py | 26 | Python | 0.714 | suggestion | 192 | 51 | 51 | false | [khan academy] Fix extractor | 3,462 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | rand-net |
)
class KhanAcademyBaseIE(InfoExtractor):
_VALID_URL_TEMPL = r'https?://(?:www\.)?khanacademy\.org/(?P<id>(?:[^/]+/){%s}%s[^?#/&]+)'
def _parse_video(self, video):
return {
'_type': 'url_transparent',
'url': video['youtubeId'],
'id': video.get('slug'),
... | ```suggestion
'fastly_cacheable': 'persist_until_publish',
'hash': '4134764944',
'lang': 'en',
``` | )
class KhanAcademyBaseIE(InfoExtractor):
_VALID_URL_TEMPL = r'https?://(?:www\.)?khanacademy\.org/(?P<id>(?:[^/]+/){%s}%s[^?#/&]+)'
def _parse_video(self, video):
return {
'_type': 'url_transparent',
'url': video['youtubeId'],
'id': video.get('slug'),
... | @@ -25,16 +25,21 @@ def _parse_video(self, video):
def _real_extract(self, url):
display_id = self._match_id(url)
- component_props = self._parse_json(self._download_json(
- 'https://www.khanacademy.org/api/internal/graphql',
+ content = self._download_json(
+ 'https:... | yt_dlp/extractor/khanacademy.py | 26 | Python | 0.714 | performance | 150 | 51 | 51 | false | [khan academy] Fix extractor | 3,462 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | rand-net |
},
}]
_TOKEN = None
def _real_initialize(self):
token = self._get_cookies('https://gofile.io/').get('accountToken')
if token:
self._TOKEN = token.value
return
account_data = self._download_json(
'https://api.gofile.io/createAccount', None... | ```suggestion
files = self._download_json(
'https://api.gofile.io/getContent', file_id, note='Getting filelist', query=query_params)
``` | },
}]
_TOKEN = None
def _real_initialize(self):
token = self._get_cookies('https://gofile.io/').get('accountToken')
if token:
self._TOKEN = token.value
return
account_data = self._download_json(
'https://api.gofile.io/createAccount', None... | @@ -52,13 +63,21 @@ def _real_initialize(self):
self._set_cookie('gofile.io', 'accountToken', self._TOKEN)
def _entries(self, file_id):
- files = self._download_json('https://api.gofile.io/getContent', 'Gofile', note='Getting filelist', query={
+ query_params = {
'contentId': ... | yt_dlp/extractor/gofile.py | 26 | Python | 0.714 | suggestion | 159 | 51 | 51 | false | [Gofile] Support password-protected links | 3,488 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
if token:
self._TOKEN = token.value
return
account_data = self._download_json(
'https://api.gofile.io/createAccount', None, note='Getting a new guest account')
self._TOKEN = account_data['data']['token']
self._set_cookie('gofile.io', 'accountToken', s... | ```suggestion
raise ExtractorError(
'This video is protected by a password, use the --video-password option', expected=True)
elif status != 'ok':
``` | if token:
self._TOKEN = token.value
return
account_data = self._download_json(
'https://api.gofile.io/createAccount', None, note='Getting a new guest account')
self._TOKEN = account_data['data']['token']
self._set_cookie('gofile.io', 'accountToken', s... | @@ -52,13 +63,21 @@ def _real_initialize(self):
self._set_cookie('gofile.io', 'accountToken', self._TOKEN)
def _entries(self, file_id):
- files = self._download_json('https://api.gofile.io/getContent', 'Gofile', note='Getting filelist', query={
+ query_params = {
'contentId': ... | yt_dlp/extractor/gofile.py | 26 | Python | 0.929 | refactor | 189 | 51 | 51 | false | [Gofile] Support password-protected links | 3,488 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
comment_list = []
for page in itertools.count(1):
comments_json = self._call_api(vid, data={
'operationName': 'getCommentList',
'variables': {
'params': {
'appInfo': {
'postID': vid,
... | Since comment extraction needs extra requests, move it into `_get_comments` and return `'__post_extractor': self.extract_comments(...)` | self._sort_formats(formats)
category = vod_info.get('categoryName')
get_count = lambda x: int_or_none(vod_info.get(x + 'Num'))
info = {
'id': vid,
'title': title,
'formats': formats,
'thumbnail': vod_info.get('coverUrl'),
'tim... | @@ -163,7 +163,31 @@ def _real_extract(self, url):
category = vod_info.get('categoryName')
get_count = lambda x: int_or_none(vod_info.get(x + 'Num'))
- comment_list = try_get(resp, lambda x: x[1]['data']['getCommentList']['commentList'], list) or []
+ comment_list = []
+ for pag... | yt_dlp/extractor/trovo.py | 26 | Python | 0.571 | refactor | 135 | 51 | 51 | false | [trovo] Update to new API, show proper error for subscriber-only videos | 3,509 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
continue
format_id = stream_info.get('desc')
formats.append({
'format_id': format_id,
'height': int_or_none(format_id[:-1]) if format_id else None,
'url': play_url,
'http_headers': self._HEADERS,
})
... | ```suggestion
'url': 'https://trovo.live/clip/lc-5285890818705062210?ltab=videos',
'params': {'getcomments': True},
'info_dict': {
``` | for stream_info in (program_info.get('streamInfo') or []):
play_url = stream_info.get('playUrl')
if not play_url:
continue
format_id = stream_info.get('desc')
formats.append({
'format_id': format_id,
'height': int_or... | @@ -90,56 +86,60 @@ def _real_extract(self, url):
class TrovoVodIE(TrovoBaseIE):
_VALID_URL = TrovoBaseIE._VALID_URL_BASE + r'(?:clip|video)/(?P<id>[^/?&#]+)'
_TESTS = [{
- 'url': 'https://trovo.live/video/ltv-100095501_100095501_1609596043',
+ 'url': 'https://trovo.live/clip/lc-528589081870506... | yt_dlp/extractor/trovo.py | 26 | Python | 0.714 | suggestion | 162 | 51 | 51 | false | [trovo] Update to new API, show proper error for subscriber-only videos | 3,509 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
import json
import random
import string
from .common import InfoExtractor
from ..utils import (
ExtractorError,
format_field,
int_or_none,
str_or_none,
)
class TrovoBaseIE(InfoExtractor):
_VALID_URL_BASE = r'https?://(?:www\.)?trovo\.live/'
_HEADERS = {'Origin': 'https://trovo.live'}
def... | ```suggestion
resp = self._download_json(
url, video_id, data=json.dumps([data]).encode(), headers={'Accept': 'application/json'},
query={
'qid': ''.join(random.choices(string.ascii_uppercase + string.digits, k=10)),
})[0]
``` | import json
import random
import string
from .common import InfoExtractor
from ..utils import (
ExtractorError,
format_field,
int_or_none,
str_or_none,
try_get,
)
class TrovoBaseIE(InfoExtractor):
_VALID_URL_BASE = r'https?://(?:www\.)?trovo\.live/'
_HEADERS = {'Origin': 'https://trovo.li... | @@ -1,24 +1,33 @@
import itertools
import json
+import random
+import string
from .common import InfoExtractor
from ..utils import (
ExtractorError,
format_field,
int_or_none,
str_or_none,
- try_get,
)
class TrovoBaseIE(InfoExtractor):
_VALID_URL_BASE = r'https?://(?:www\.)?trovo... | yt_dlp/extractor/trovo.py | 26 | Python | 0.786 | suggestion | 292 | 51 | 51 | false | [trovo] Update to new API, show proper error for subscriber-only videos | 3,509 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
def _real_extract(self, url):
vid = self._match_id(url)
# NOTE: It is also possible to extract this info from the Nuxt data on the website,
# however that seems unreliable - sometimes it randomly doesn't return the data,
# at least when using a non-residential IP.
resp = se... | ```suggestion
if try_get(vod_info, lambda x: x['playbackRights']['playbackRights'] != 'Normal'):
``` | 'url': 'https://trovo.live/video/ltv-100095501_100095501_1609596043',
'only_matching': True,
}]
def _real_extract(self, url):
vid = self._match_id(url)
# NOTE: It is also possible to extract this info from the Nuxt data on the website,
# however that seems unreliable - ... | @@ -90,56 +86,61 @@ def _real_extract(self, url):
class TrovoVodIE(TrovoBaseIE):
_VALID_URL = TrovoBaseIE._VALID_URL_BASE + r'(?:clip|video)/(?P<id>[^/?&#]+)'
_TESTS = [{
- 'url': 'https://trovo.live/video/ltv-100095501_100095501_1609596043',
+ 'url': 'https://trovo.live/clip/lc-528589081870506... | yt_dlp/extractor/trovo.py | 26 | Python | 0.714 | suggestion | 110 | 51 | 51 | false | [trovo] Update to new API, show proper error for subscriber-only videos | 3,509 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
},
'extensions': {
'persistedQuery': {
'version': 1,
'sha256Hash': 'be8e5f9522ddac7f7c604c0d284fd22481813263580849926c4c66fb767eed25',
},
},
})
comment_list += ... | ```suggestion
for comment in comments_json['commentList']:
content = comment.get('content')
if not content:
continue
author = comment.get('author') or {}
parent = comment.get('parentID')
yield {
... | 'page': page,
},
},
'extensions': {
'persistedQuery': {
'version': 1,
'sha256Hash': 'be8e5f9522ddac7f7c604c0d284fd22481813263580849926c4c66fb767eed25',
},
... | @@ -190,12 +174,53 @@ def _real_extract(self, url):
'view_count': get_count('watch'),
'like_count': get_count('like'),
'comment_count': get_count('comment'),
- 'comments': comments,
'categories': [category] if category else None,
+ '__post_extrac... | yt_dlp/extractor/trovo.py | 26 | Python | 0.786 | security | 782 | 51 | 51 | false | [trovo] Update to new API, show proper error for subscriber-only videos | 3,509 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
import itertools
import json
import random
import string
from .common import InfoExtractor
from ..utils import (
ExtractorError,
format_field,
int_or_none,
str_or_none,
)
class TrovoBaseIE(InfoExtractor):
_VALID_URL_BASE = r'https?://(?:www\.)?trovo\.live/'
_HEADERS = {'Origin': 'https://trov... | ```suggestion
try_get,
``` | import itertools
import json
import random
import string
from .common import InfoExtractor
from ..utils import (
ExtractorError,
format_field,
int_or_none,
str_or_none,
try_get,
)
class TrovoBaseIE(InfoExtractor):
_VALID_URL_BASE = r'https?://(?:www\.)?trovo\.live/'
_HEADERS = {'Origin': ... | @@ -1,24 +1,35 @@
import itertools
import json
+import random
+import string
from .common import InfoExtractor
from ..utils import (
ExtractorError,
format_field,
int_or_none,
str_or_none,
- try_get, | yt_dlp/extractor/trovo.py | 10 | Python | 0.429 | suggestion | 32 | 35 | 35 | false | [trovo] Update to new API, show proper error for subscriber-only videos | 3,509 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
thumbnail_ext = os.path.splitext(thumbnail_filename)[1][1:]
if info['ext'] not in ['mkv', 'mka']:
# Convert unsupported thumbnail formats to PNG (see #25687, #25717)
# Original behavior was to convert to JPG, but since JPG is a lossy
# format, there will be some addi... | ```suggestion
mimetype = 'image/%s' % ('jpeg' if thumbnail_ext in ('jpg', 'jpeg') else thumbnail_ext)
``` |
thumbnail_ext = os.path.splitext(thumbnail_filename)[1][1:]
# Convert unsupported thumbnail formats (see #25687, #25717)
# PNG is preferred since JPEG is lossy
if info['ext'] not in ('mkv', 'mka') and thumbnail_ext not in ('jpg', 'jpeg', 'png'):
thumbnail_filename = converto... | @@ -102,7 +103,7 @@ def run(self, info):
elif info['ext'] in ['mkv', 'mka']:
options = list(self.stream_copy_opts())
- mimetype = 'image/%s' % ('png' if thumbnail_ext == 'png' else 'jpeg')
+ mimetype = 'image/%s' % ('jpeg' if thumbnail_ext == 'jpg' else thumbnail_ext) | yt_dlp/postprocessor/embedthumbnail.py | 26 | Python | 0.857 | suggestion | 119 | 51 | 51 | false | Disable thumbnail conversion for mkv | 3,512 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Evan-sp |
return [], info
idx = next((-i for i, t in enumerate(info['thumbnails'][::-1], 1) if t.get('filepath')), None)
if idx is None:
self.to_screen('There are no thumbnails on disk')
return [], info
thumbnail_filename = info['thumbnails'][idx]['filepath']
i... | ```suggestion
# Convert unsupported thumbnail formats (see #25687, #25717)
# PNG is preferred since JPEG is lossy
if info['ext'] not in ('mkv', 'mka') and thumbnail_ext not in ('jpg', 'jpeg', 'png'):
thumbnail_filename = convertor.convert_thumbnail(thumbnail_filename, 'png')
... | return [], info
idx = next((-i for i, t in enumerate(info['thumbnails'][::-1], 1) if t.get('filepath')), None)
if idx is None:
self.to_screen('There are no thumbnails on disk')
return [], info
thumbnail_filename = info['thumbnails'][idx]['filepath']
i... | @@ -79,14 +79,15 @@ def run(self, info):
original_thumbnail = thumbnail_filename = info['thumbnails'][idx]['filepath']
- # Convert unsupported thumbnail formats to PNG (see #25687, #25717)
- # Original behavior was to convert to JPG, but since JPG is a lossy
- # format, there will be s... | yt_dlp/postprocessor/embedthumbnail.py | 26 | Python | 0.857 | suggestion | 355 | 51 | 51 | false | Disable thumbnail conversion for mkv | 3,512 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Evan-sp |
convertor.fixup_webp(info, idx)
original_thumbnail = thumbnail_filename = info['thumbnails'][idx]['filepath']
# Convert unsupported thumbnail formats to PNG (see #25687, #25717)
# Original behavior was to convert to JPG, but since JPG is a lossy
# format, there will be some add... | re-thinking this, it could also be simplified to
```suggestion
mimetype = f'image/{thumbnail_ext.replace("jpg", "jpeg")}'
``` | convertor.fixup_webp(info, idx)
original_thumbnail = thumbnail_filename = info['thumbnails'][idx]['filepath']
thumbnail_ext = os.path.splitext(thumbnail_filename)[1][1:]
# Convert unsupported thumbnail formats (see #25687, #25717)
# PNG is preferred since JPEG is lossy
... | @@ -102,7 +100,7 @@ def run(self, info):
elif info['ext'] in ['mkv', 'mka']:
options = list(self.stream_copy_opts())
- mimetype = 'image/%s' % ('png' if thumbnail_ext == 'png' else 'jpeg')
+ mimetype = 'image/%s' % ('jpeg' if thumbnail_ext in ('jpg', 'jpeg') else thumbnail_... | yt_dlp/postprocessor/embedthumbnail.py | 26 | Python | 0.929 | suggestion | 140 | 51 | 51 | false | Disable thumbnail conversion for mkv | 3,512 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Evan-sp |
from .common import InfoExtractor
class LCIIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?lci\.fr/[^/]+/[\w-]+-(?P<id>\d+)\.html'
_TEST = {
'url': 'http://www.lci.fr/international/etats-unis-a-j-62-hillary-clinton-reste-sans-voix-2001679.html',
'md5': '2fdb2538b884d4d695f9bd2bde137e6c',
... | Are you sure the old regexes are no longer usefull? |
class LCIIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?(?:lci|tf1info)\.fr/[^/]+/[\w-]+-(?P<id>\d+)\.html'
_TESTS = [{
'url': 'https://www.tf1info.fr/politique/election-presidentielle-2022-second-tour-j-2-marine-le-pen-et-emmanuel-macron-en-interview-de-lci-vendredi-soir-2217486.html',
... | @@ -2,22 +2,27 @@
class LCIIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?lci\.fr/[^/]+/[\w-]+-(?P<id>\d+)\.html'
- _TEST = {
- 'url': 'http://www.lci.fr/international/etats-unis-a-j-62-hillary-clinton-reste-sans-voix-2001679.html',
- 'md5': '2fdb2538b884d4d695f9bd2bde137e6c',
+ _VAL... | yt_dlp/extractor/lci.py | 24 | Python | 0.286 | question | 51 | 24 | 28 | false | [LCI] Fix extractor | 3,534 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
'url': 'https://www.ruutu.fi/video/3618715',
'only_matching': True,
},
]
_API_BASE = 'https://gatling.nelonenmedia.fi'
@classmethod
def _extract_urls(cls, webpage):
# nelonen.fi
settings = try_call(
lambda: json.loads(re.search(
... | this is unreadable. I can barely tell where each bracket ends. Also, traverse_obj can handle all this filter and loop. Try this: (untested)
```suggestion
video_ids = traverse_obj(settings, ('props', 'pageProps', 'page', 'assetData', 'splitBody', ..., 'video', 'sourceId'))
```
PS: The `...` is literal
| 'episode_number': 17,
'categories': ['Reality ja tositapahtumat', 'Kotimaiset suosikit', 'Romantiikka ja parisuhde'],
},
'params': {
'skip_download': True,
},
},
{
# premium
'url': 'https://www.ru... | @@ -126,14 +126,27 @@ class RuutuIE(InfoExtractor):
_API_BASE = 'https://gatling.nelonenmedia.fi'
@classmethod
- def _extract_url(cls, webpage):
+ def _extract_urls(cls, webpage):
+ # nelonen.fi
settings = try_call(
lambda: json.loads(re.search(
r'jQuery\.... | yt_dlp/extractor/ruutu.py | 26 | Python | 0.929 | suggestion | 319 | 51 | 51 | false | [ruutu] Add hs.fi embeds | 3,547 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | tpikonen |
},
},
{
# premium
'url': 'https://www.ruutu.fi/video/3618715',
'only_matching': True,
},
]
_API_BASE = 'https://gatling.nelonenmedia.fi'
@classmethod
def _extract_urls(cls, webpage):
# nelonen.fi
settings = try_call... | ```suggestion
lambda: json.loads(re.search(
'(?s)<script[^>]+id=[\'"]__NEXT_DATA__[\'"][^>]*>([^<]+)</script>',
webpage).group(1), strict=False))
``` | 'age_limit': 12,
'upload_date': '20190508',
'series': 'Temptation Island Suomi',
'season_number': 5,
'episode_number': 17,
'categories': ['Reality ja tositapahtumat', 'Kotimaiset suosikit', 'Romantiikka ja parisuhde'],
... | @@ -126,14 +126,27 @@ class RuutuIE(InfoExtractor):
_API_BASE = 'https://gatling.nelonenmedia.fi'
@classmethod
- def _extract_url(cls, webpage):
+ def _extract_urls(cls, webpage):
+ # nelonen.fi
settings = try_call(
lambda: json.loads(re.search(
r'jQuery\.... | yt_dlp/extractor/ruutu.py | 26 | Python | 0.714 | suggestion | 197 | 51 | 51 | false | [ruutu] Add hs.fi embeds | 3,547 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | tpikonen |
from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
try_get
)
class LRTStreamIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/tiesiogiai/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://www.lrt.lt/mediateka/tiesiogiai/lrt-opus',
'info_d... | this code is repeated. Either move it into a base class, or, if the code is robust enough*, this could be useful in common.py as well
\* it needs a `\s`/`\b` at the start. Otherwise, looks robust to me | from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
traverse_obj,
url_or_none,
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
fr'{var_name}\s*=\s*(["\'])((?:(?!\1).)+)\1',
... | @@ -2,16 +2,61 @@
from ..utils import (
clean_html,
merge_dicts,
+ try_get
)
-class LRTIE(InfoExtractor):
- IE_NAME = 'lrt.lt'
+class LRTStreamIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/tiesiogiai/(?P<id>[\w-]+)'
+ _TESTS = [{
+ 'url': 'https://www.lrt.lt... | yt_dlp/extractor/lrt.py | 24 | Python | 0.643 | suggestion | 204 | 49 | 49 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
'title': 're:^LRT Opus.+$',
'ext': 'mp4'
}
}]
def _extract_js_var(self, webpage, var_name, default):
return self._search_regex(
r'%s\s*=\s*(["\'])((?:(?!\1).)+)\1' % var_name,
webpage, var_name.replace('_', ' '), default, group=2)
def _real_e... | If you are trying to get all keys that start with `content`, you can do:
```suggestion
for stream_url in traverse_obj(streams_data, ('response', 'data', lambda k, _: k.startswith('content')), expected_type=url_or_none):
```
You can also use `in` or `re.match` depending on the exact requirement
PS: feel f... |
class LRTStreamIE(LRTBaseIE):
_VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/tiesiogiai/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://www.lrt.lt/mediateka/tiesiogiai/lrt-opus',
'info_dict': {
'id': 'lrt-opus',
'live_status': 'is_live',
'title': 're:^LRT Op... | @@ -2,16 +2,61 @@
from ..utils import (
clean_html,
merge_dicts,
+ try_get
)
-class LRTIE(InfoExtractor):
- IE_NAME = 'lrt.lt'
+class LRTStreamIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/tiesiogiai/(?P<id>[\w-]+)'
+ _TESTS = [{
+ 'url': 'https://www.lrt.lt... | yt_dlp/extractor/lrt.py | 26 | Python | 1 | suggestion | 367 | 51 | 51 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
'ext': 'mp4'
}
}]
def _extract_js_var(self, webpage, var_name, default):
return self._search_regex(
r'%s\s*=\s*(["\'])((?:(?!\1).)+)\1' % var_name,
webpage, var_name.replace('_', ' '), default, group=2)
def _real_extract(self, url):
matches = sel... | Use _extract_m3u8_formats_and_subtitles | class LRTStreamIE(LRTBaseIE):
_VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/tiesiogiai/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://www.lrt.lt/mediateka/tiesiogiai/lrt-opus',
'info_dict': {
'id': 'lrt-opus',
'live_status': 'is_live',
'title': 're:^LRT Opu... | @@ -2,16 +2,61 @@
from ..utils import (
clean_html,
merge_dicts,
+ try_get
)
-class LRTIE(InfoExtractor):
- IE_NAME = 'lrt.lt'
+class LRTStreamIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/tiesiogiai/(?P<id>[\w-]+)'
+ _TESTS = [{
+ 'url': 'https://www.lrt.lt... | yt_dlp/extractor/lrt.py | 26 | Python | 0.143 | refactor | 39 | 51 | 51 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
streams_data = self._download_json(token_url, video_id)
formats = []
for key in ['content', 'content2', 'content3']:
stream_url = try_get(streams_data, lambda x: x['response']['data'][key])
if stream_url == '':
continue
formats.extend(self._e... | md5 of fragmented downloads keep changing. This should have never had md5 in the test definition
```suggestion
``` | formats, subtitles = [], {}
for stream_url in traverse_obj(streams_data, (
'response', 'data', lambda k, _: k.startswith('content')), expected_type=url_or_none):
fmts, subs = self._extract_m3u8_formats_and_subtitles(stream_url, video_id, 'mp4', m3u8_id='hls', live=True)
... | @@ -2,16 +2,61 @@
from ..utils import (
clean_html,
merge_dicts,
+ try_get
)
-class LRTIE(InfoExtractor):
- IE_NAME = 'lrt.lt'
+class LRTStreamIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?lrt\.lt/mediateka/tiesiogiai/(?P<id>[\w-]+)'
+ _TESTS = [{
+ 'url': 'https://www.lrt.lt... | yt_dlp/extractor/lrt.py | 26 | Python | 0.786 | suggestion | 116 | 51 | 51 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
url_or_none,
traverse_obj
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
f'{var_name}\\s*=\\s*(["\'])((?:(?!\\1).)+)\\1',
... | ```suggestion
fr'{var_name}\s*=\s*(["\'])((?:(?!\1).)+)\1',
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
traverse_obj,
url_or_none,
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
fr'{var_name}\s*=\s*(["\'])((?:(?!\1).)+)\1',
... | @@ -2,61 +2,66 @@
from ..utils import (
clean_html,
merge_dicts,
- try_get
+ url_or_none,
+ traverse_obj
)
-class LRTStreamIE(InfoExtractor):
+class LRTBaseIE(InfoExtractor):
+ def _extract_js_var(self, webpage, var_name, default=None):
+ return self._search_regex(
+ f'{var... | yt_dlp/extractor/lrt.py | 13 | Python | 0.571 | suggestion | 77 | 38 | 38 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
_TESTS = [{
'url': 'https://www.lrt.lt/mediateka/tiesiogiai/lrt-opus',
'info_dict': {
'id': 'lrt-opus',
'live_status': 'is_live',
'title': 're:^LRT Opus.+$',
'ext': 'm3u8'
}
}]
def _real_extract(self, url):
matches = self._matc... | ```suggestion
formats, subtitles = self._extract_m3u8_formats_and_subtitles(stream_url, _match_id, 'mp4', m3u8_id='hls', live=True)
``` | _TESTS = [{
'url': 'https://www.lrt.lt/mediateka/tiesiogiai/lrt-opus',
'info_dict': {
'id': 'lrt-opus',
'live_status': 'is_live',
'title': 're:^LRT Opus.+$',
'ext': 'mp4'
}
}]
def _real_extract(self, url):
video_id = self._matc... | @@ -2,61 +2,66 @@
from ..utils import (
clean_html,
merge_dicts,
- try_get
+ url_or_none,
+ traverse_obj
)
-class LRTStreamIE(InfoExtractor):
+class LRTBaseIE(InfoExtractor):
+ def _extract_js_var(self, webpage, var_name, default=None):
+ return self._search_regex(
+ f'{var... | yt_dlp/extractor/lrt.py | 26 | Python | 0.786 | refactor | 149 | 51 | 51 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
traverse_obj
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
f'{var_name}\\s*=\\s*(["\'])((?:(?!\\1).)+)\\1',
webpage, var_name.replace('_', ' '), default, group=2)
class LRTStreamIE(LRTBaseIE):
_VAL... | I meant:
```suggestion
video_id = self._match_id(url)
``` | url_or_none,
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
fr'{var_name}\s*=\s*(["\'])((?:(?!\1).)+)\1',
webpage, var_name.replace('_', ' '), default, group=2)
class LRTStreamIE(LRTBaseIE):
_VALID_... | @@ -2,16 +2,66 @@
from ..utils import (
clean_html,
merge_dicts,
+ url_or_none,
+ traverse_obj
)
-class LRTIE(InfoExtractor):
- IE_NAME = 'lrt.lt'
+class LRTBaseIE(InfoExtractor):
+ def _extract_js_var(self, webpage, var_name, default=None):
+ return self._search_regex(
+ f... | yt_dlp/extractor/lrt.py | 26 | Python | 0.571 | suggestion | 68 | 51 | 51 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
webpage = self._download_webpage(url, _match_id)
token_url = self._extract_js_var(webpage, 'tokenURL')
stream_title = self._extract_js_var(webpage, 'video_title', 'LRT')
title = self._og_search_title(webpage)
streams_data = self._download_json(token_url, _match_id)
str... | ```suggestion
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
streams_data = self._download_json(self._extract_js_var(webpage, 'tokenURL'), video_id)
formats, subtitles = [], {}
for stream_url in traverse_obj(streams_data, (
... | streams_data = self._download_json(self._extract_js_var(webpage, 'tokenURL'), video_id)
formats, subtitles = [], {}
for stream_url in traverse_obj(streams_data, (
'response', 'data', lambda k, _: k.startswith('content')), expected_type=url_or_none):
fmts, subs = self... | @@ -2,16 +2,66 @@
from ..utils import (
clean_html,
merge_dicts,
+ url_or_none,
+ traverse_obj
)
-class LRTIE(InfoExtractor):
- IE_NAME = 'lrt.lt'
+class LRTBaseIE(InfoExtractor):
+ def _extract_js_var(self, webpage, var_name, default=None):
+ return self._search_regex(
+ f... | yt_dlp/extractor/lrt.py | 26 | Python | 1 | refactor | 979 | 51 | 51 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
url_or_none,
traverse_obj
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
fr'{var_name}\s*=\s*(["\'])((?:(?!\1).)+)\1',
... | ```suggestion
traverse_obj,
url_or_none,
``` | from .common import InfoExtractor
from ..utils import (
clean_html,
merge_dicts,
traverse_obj,
url_or_none,
)
class LRTBaseIE(InfoExtractor):
def _extract_js_var(self, webpage, var_name, default=None):
return self._search_regex(
fr'{var_name}\s*=\s*(["\'])((?:(?!\1).)+)\1',
... | @@ -2,16 +2,58 @@
from ..utils import (
clean_html,
merge_dicts,
+ url_or_none,
+ traverse_obj | yt_dlp/extractor/lrt.py | 6 | Python | 0.571 | suggestion | 55 | 31 | 31 | false | [lrt] improve extractor | 3,555 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | GiedriusS |
'X-Frontend-ID': '6',
'X-Frontend-Version': '0',
'X-Niconico-Language': 'en-us',
'Referer': 'https://www.nicovideo.jp/',
'Origin': 'https://www.nicovideo.jp',
}
def _perform_login(self, username, password):
login_ok = True
login_form_strs = {
... | ```suggestion
r'<form action=["\']([^"\'])["\']', resp_page, 'mfa_submit',
```
why use lookahead/behind? | 'X-Frontend-Version': '0',
'X-Niconico-Language': 'en-us',
'Referer': 'https://www.nicovideo.jp/',
'Origin': 'https://www.nicovideo.jp',
}
def _perform_login(self, username, password):
login_ok = True
login_form_strs = {
'mail_tel': username,
... | @@ -192,20 +190,38 @@ def _perform_login(self, username, password):
self._request_webpage(
'https://account.nicovideo.jp/login', None,
note='Acquiring Login session')
- urlh = self._request_webpage(
+ resp_page = self._request_webpage(
'https://account.nicov... | yt_dlp/extractor/niconico.py | 26 | Python | 0.786 | question | 123 | 51 | 51 | false | Fix `NiconicoIE` login | 3,559 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ekangmonyet |
headers={
'Referer': 'https://account.nicovideo.jp/login',
'Content-Type': 'application/x-www-form-urlencoded',
})
if urlh is False:
login_ok = False
else:
parts = compat_urllib_parse_urlparse(urlh.geturl())
if c... | I guess it should be: (this is optional, you can silently discard it)
```suggestion
self.report_warning(f'Unable to log in: MFA challenge failed, "{err_msg}"')
``` | 'Referer': 'https://account.nicovideo.jp/login',
'Content-Type': 'application/x-www-form-urlencoded',
})
if 'oneTimePw' in page:
post_url = self._search_regex(
r'<form[^>]+action=(["\'])(?P<url>.+?)\1', page, 'post url', group='url')
... | @@ -192,20 +191,39 @@ def _perform_login(self, username, password):
self._request_webpage(
'https://account.nicovideo.jp/login', None,
note='Acquiring Login session')
- urlh = self._request_webpage(
+ page = self._download_webpage(
'https://account.nicovideo... | yt_dlp/extractor/niconico.py | 26 | Python | 0.786 | bug | 182 | 51 | 51 | false | Fix `NiconicoIE` login | 3,559 | yt-dlp/yt-dlp | 132,642 | Python | Lesmiscore | ekangmonyet |
self._request_webpage(
'https://account.nicovideo.jp/login', None,
note='Acquiring Login session')
page = self._download_webpage(
'https://account.nicovideo.jp/login/redirector?show_button_twitter=1&site=niconico&show_button_facebook=1', None,
note='Loggin... | ```suggestion
page = self._download_webpage(
urljoin('https://account.nicovideo.jp', post_url), None,
note='Performing MFA', errnote='Unable to complete MFA',
data=urlencode_postdata({
'otp': self._get_tfa_info('6 digits code')
... | self._request_webpage(
'https://account.nicovideo.jp/login', None,
note='Acquiring Login session')
page = self._download_webpage(
'https://account.nicovideo.jp/login/redirector?show_button_twitter=1&site=niconico&show_button_facebook=1', None,
note='Loggin... | @@ -192,22 +191,41 @@ def _perform_login(self, username, password):
self._request_webpage(
'https://account.nicovideo.jp/login', None,
note='Acquiring Login session')
- urlh = self._request_webpage(
+ page = self._download_webpage(
'https://account.nicovideo... | yt_dlp/extractor/niconico.py | 26 | Python | 0.929 | suggestion | 442 | 51 | 51 | false | Fix `NiconicoIE` login | 3,559 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ekangmonyet |
'Referer': 'https://www.nicovideo.jp/',
'Origin': 'https://www.nicovideo.jp',
}
def _perform_login(self, username, password):
login_ok = True
login_form_strs = {
'mail_tel': username,
'password': password,
}
self._request_webpage(
... | ```suggestion
if 'oneTimePw' in page:
post_url = self._search_regex(
r'<form[^>]+action=(["\'])(?P<url>.+?)\1', page, 'post url', group='url')
``` | 'Referer': 'https://www.nicovideo.jp/',
'Origin': 'https://www.nicovideo.jp',
}
def _perform_login(self, username, password):
login_ok = True
login_form_strs = {
'mail_tel': username,
'password': password,
}
self._request_webpage(
... | @@ -192,22 +191,41 @@ def _perform_login(self, username, password):
self._request_webpage(
'https://account.nicovideo.jp/login', None,
note='Acquiring Login session')
- urlh = self._request_webpage(
+ page = self._download_webpage(
'https://account.nicovideo... | yt_dlp/extractor/niconico.py | 26 | Python | 0.714 | suggestion | 186 | 51 | 51 | false | Fix `NiconicoIE` login | 3,559 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ekangmonyet |
page = self._download_webpage(
'https://account.nicovideo.jp/login/redirector?show_button_twitter=1&site=niconico&show_button_facebook=1', None,
note='Logging in', errnote='Unable to log in',
data=urlencode_postdata(login_form_strs),
headers={
'Ref... | ```suggestion
if 'oneTimePw' in page or 'formError' in page:
``` | page = self._download_webpage(
'https://account.nicovideo.jp/login/redirector?show_button_twitter=1&site=niconico&show_button_facebook=1', None,
note='Logging in', errnote='Unable to log in',
data=urlencode_postdata(login_form_strs),
headers={
'Ref... | @@ -192,22 +191,41 @@ def _perform_login(self, username, password):
self._request_webpage(
'https://account.nicovideo.jp/login', None,
note='Acquiring Login session')
- urlh = self._request_webpage(
+ page = self._download_webpage(
'https://account.nicovideo... | yt_dlp/extractor/niconico.py | 26 | Python | 0.714 | suggestion | 78 | 51 | 51 | false | Fix `NiconicoIE` login | 3,559 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ekangmonyet |
def _sleep(self, timeout, video_id, msg_template=None):
if msg_template is None:
msg_template = '%(video_id)s: Waiting for %(timeout)s seconds'
msg = msg_template % {'video_id': video_id, 'timeout': timeout}
self.to_screen(msg)
time.sleep(timeout)
def _extract_f4m_f... | this is unreachable now. Similar for the other functions |
def _sleep(self, timeout, video_id, msg_template=None):
if msg_template is None:
msg_template = '%(video_id)s: Waiting for %(timeout)s seconds'
msg = msg_template % {'video_id': video_id, 'timeout': timeout}
self.to_screen(msg)
time.sleep(timeout)
def _extract_f4m_f... | @@ -1982,13 +1982,18 @@ def _sleep(self, timeout, video_id, msg_template=None):
def _extract_f4m_formats(self, manifest_url, video_id, preference=None, quality=None, f4m_id=None,
transform_source=lambda s: fix_xml_ampersands(s).strip(),
fatal=True, m3u8_i... | yt_dlp/extractor/common.py | 26 | Python | 0.214 | suggestion | 56 | 51 | 51 | false | [extractor/common] Use validated url in various extractors | 3,575 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
'full_title': 'Monstruoso',
'description': 'md5:333fc19ee327b457b980e54a911ea4a3',
'ext': 'mp4',
}
}]
def _extract_video(self, contentId, action="olyott_video_play"):
request_body = {
'action': action,
'contentID': contentId,
}... | 1. read our coding conventions
2. errors should be thrown, not `return False`
3. Why is this non-fatal?
4. the `note` you added is no better than the default
```py
response = self._download_json(
'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
contentId, fatal=False ... | 'id': '428021',
'title': 'Atrápame Si Puedes',
'description': 'md5:ca63bc00898aeb2f64ec87c6d3a5b982',
'ext': 'mp4',
}
}, {
'url': 'https://www.freetv.com/peliculas/monstruoso/',
'md5': '509c15c68de41cb708d1f92d071f20aa',
'info_dict': {
... | @@ -0,0 +1,107 @@
+from .common import InfoExtractor
+from ..utils import (
+ urlencode_postdata,
+ determine_ext,
+)
+
+
+class FreeTvIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?freetv\.com/(?:peliculas|series)/(?:[^/]+/)*(?P<id>[^/]+)'
+ _TESTS = [{
+ 'url': 'https://www.freetv.com/pelic... | yt_dlp/extractor/freetv.py | 26 | Python | 1 | refactor | 575 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
response = self._download_json(
'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
contentId,
'Downloading %s video JSON' % contentId,
data=urlencode_postdata(request_body),
fatal=False
)
if response is False:
retu... | 1. Get rid of variables that are only used once
2. Lack of video id/URL should throw error. So make their extraction fatal | 'ext': 'mp4',
}
}]
def _extract_video(self, content_id, action='olyott_video_play'):
api_response = self._get_api_response(content_id, 'video', {
'action': action,
'contentID': content_id,
})
video_id, video_url = api_response['displayMeta'][... | @@ -0,0 +1,107 @@
+from .common import InfoExtractor
+from ..utils import (
+ urlencode_postdata,
+ determine_ext,
+)
+
+
+class FreeTvIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?freetv\.com/(?:peliculas|series)/(?:[^/]+/)*(?P<id>[^/]+)'
+ _TESTS = [{
+ 'url': 'https://www.freetv.com/pelic... | yt_dlp/extractor/freetv.py | 26 | Python | 0.571 | refactor | 123 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
video_url = video_metadata.get('streamURLVideo')
formats = []
subtitles = []
ext = determine_ext(video_url)
if ext == "m3u8":
fmts, subs = self._extract_m3u8_formats_and_subtitles(
video_url, video_id, 'mp4',
entry_protocol='m3u8_nat... | `full_title` is not an allowed field |
return self._extract_video(
self._search_regex((
r'class=["\'][^>]+postid-(?P<video_id>\d+)',
r'<link[^>]+freetv.com/\?p=(?P<video_id>\d+)',
r'<div[^>]+data-params=["\'][^>]+post_id=(?P<video_id>\d+)',
), webpage, 'video id', group='video_... | @@ -0,0 +1,107 @@
+from .common import InfoExtractor
+from ..utils import (
+ urlencode_postdata,
+ determine_ext,
+)
+
+
+class FreeTvIE(InfoExtractor):
+ _VALID_URL = r'https?://(?:www\.)?freetv\.com/(?:peliculas|series)/(?:[^/]+/)*(?P<id>[^/]+)'
+ _TESTS = [{
+ 'url': 'https://www.freetv.com/pelic... | yt_dlp/extractor/freetv.py | 26 | Python | 0.214 | suggestion | 36 | 46 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
try_get,
urlencode_postdata, int_or_none, str_or_none,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, postdata, resource_type):
response = self._download_json(
... | Why are these `expected=True`? Actually, why are these even needed? This is in effect the same as not setting `fatal=False` above | import itertools
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
traverse_obj,
urlencode_postdata,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, resource_type, postdata):
return self._download_json(
'https://www.freetv.... | @@ -0,0 +1,186 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ try_get,
+ urlencode_postdata, int_or_none, str_or_none,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_type):
+ re... | yt_dlp/extractor/freetv.py | 23 | Python | 0.5 | question | 129 | 48 | 48 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
for season_id in season_ids:
api_response = self._get_api_response(
season_id, resource_type='series',
postdata={
'action': action,
'contentID': season_id,
'type': 'list',
'perPage': '1000... | These are single use variables. Inline them in the return | }
def _real_extract(self, url):
display_id = self._match_id(url)
webpage = self._download_webpage(url, display_id)
return self._extract_video(
self._search_regex((
r'class=["\'][^>]+postid-(?P<video_id>\d+)',
r'<link[^>]+freetv.com/\?p=(?... | @@ -0,0 +1,186 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ try_get,
+ urlencode_postdata, int_or_none, str_or_none,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_type):
+ re... | yt_dlp/extractor/freetv.py | 26 | Python | 0.286 | suggestion | 57 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
def _get_api_response(self, content_id, postdata, resource_type):
response = self._download_json(
'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
content_id, data=urlencode_postdata(postdata), fatal=False,
note='Downloading {} {} JSON'.format(content_id, resou... | FYI, `try_get(A, lambda x: x[b][c][d])` can be written as `traverse_obj(A, (b, c, d))`. Both are fine, just letting u know since `traverse_obj` is generally easier | def _get_api_response(self, content_id, resource_type, postdata):
return self._download_json(
'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
content_id, data=urlencode_postdata(postdata),
note=f'Downloading {content_id} {resource_type} JSON')['data']
class ... | @@ -0,0 +1,186 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ try_get,
+ urlencode_postdata, int_or_none, str_or_none,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_type):
+ re... | yt_dlp/extractor/freetv.py | 26 | Python | 0.5 | suggestion | 163 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
series_id = try_get(episode, lambda x: x['contentMeta']['displayMeta']['seriesID'])
season_id = try_get(episode, lambda x: x['contentMeta']['displayMeta']['seasonID'])
season_number = int_or_none(try_get(episode, lambda x: x['contentMeta']['displayMeta']['seasonNum']))
... | use `raise ExtractorError` or `self.report_warning` as appropriate | 'title': 'El Detective L',
'description': 'md5:f9f1143bc33e9856ecbfcbfb97a759be'
},
'playlist_count': 24,
}, {
'url': 'https://www.freetv.com/series/esmeraldas/',
'info_dict': {
'id': 'esmeraldas',
'title': 'Esmeraldas',
'de... | @@ -0,0 +1,186 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ try_get,
+ urlencode_postdata, int_or_none, str_or_none,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_type):
+ re... | yt_dlp/extractor/freetv.py | 26 | Python | 0.571 | refactor | 66 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
str_or_none,
traverse_obj,
urlencode_postdata,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, postdata, resource_type):
response = self._down... | ```suggestion
content_id, data=urlencode_postdata(postdata),
```
this is default | import itertools
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
traverse_obj,
urlencode_postdata,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, resource_type, postdata):
return self._download_json(
'https://www.freetv.... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 18 | Python | 0.571 | suggestion | 95 | 43 | 43 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
str_or_none,
traverse_obj,
urlencode_postdata,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, postdata, resource_type):
response = self._down... | `Response doesn't contain ...` means nothing to the user. So I don't understand why this error message is needed (as opposed to the default error of `reponse['data']`. But if u r doing it, it should be
```suggestion
if not response.get('data'):
raise ExtractorError(f"Response doesn't contain {re... | import itertools
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
traverse_obj,
urlencode_postdata,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, resource_type, postdata):
return self._download_json(
'https://www.freetv.... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 22 | Python | 1 | refactor | 344 | 47 | 47 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
ExtractorError,
int_or_none,
str_or_none,
traverse_obj,
urlencode_postdata,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, postdata, resource_type):
response = self._down... | imo, it makes sense to return `response['data']` | import itertools
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
traverse_obj,
urlencode_postdata,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, resource_type, postdata):
return self._download_json(
'https://www.freetv.... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 24 | Python | 0.214 | suggestion | 48 | 49 | 49 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
traverse_obj,
urlencode_postdata,
)
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, postdata, resource_type):
response = self._download_json(
'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
content_id, data=urlencode_postdata(postdata)... | This should be fatal
```suggestion
video_id = api_response['data']['displayMeta']['contentID']
``` | )
class FreeTvBaseIE(InfoExtractor):
def _get_api_response(self, content_id, resource_type, postdata):
return self._download_json(
'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
content_id, data=urlencode_postdata(postdata),
note=f'Downloading {content_id} ... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 26 | Python | 0.786 | suggestion | 109 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
def _get_api_response(self, content_id, postdata, resource_type):
response = self._download_json(
'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
content_id, data=urlencode_postdata(postdata), fatal=True,
note=f'Downloading {content_id} {resource_type} JSON')
... | what's the point of this? Did you mean this?
```suggestion
video_url = traverse_obj(api_response, ('data', 'displayMeta', 'streamURLVideo'), expected_type=str)
formats, subtitles = [], {}
if determine_ext(video_url) != 'm3u8':
self.raise_no_formats('Manifest was not found', vi... | 'https://www.freetv.com/wordpress/wp-admin/admin-ajax.php',
content_id, data=urlencode_postdata(postdata),
note=f'Downloading {content_id} {resource_type} JSON')['data']
class FreeTvMoviesIE(FreeTvBaseIE):
_VALID_URL = r'https?://(?:www\.)?freetv\.com/peliculas/(?P<id>[^/]+)'
... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 26 | Python | 1 | refactor | 444 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
for episode in season_episodes:
video_id = str_or_none(episode.get('contentID'))
video_url = episode.get('streamURL')
if determine_ext(video_url) == 'm3u8':
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
... | create a generator and pass it as the entries to playlist_result | ), webpage, 'video id', group='video_id'))
class FreeTvIE(FreeTvBaseIE):
IE_NAME = 'freetv:series'
_VALID_URL = r'https?://(?:www\.)?freetv\.com/series/(?P<id>[^/]+)'
_TESTS = [{
'url': 'https://www.freetv.com/series/el-detective-l/',
'info_dict': {
'id': 'el-detect... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 26 | Python | 0.214 | suggestion | 64 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
}, {
'url': 'https://www.freetv.com/peliculas/monstruoso/',
'md5': '509c15c68de41cb708d1f92d071f20aa',
'info_dict': {
'id': '377652',
'title': 'Monstruoso',
'description': 'md5:333fc19ee327b457b980e54a911ea4a3',
'ext': 'mp4',
}
}]
... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?freetv\.com/series/(?:[^/]+/)*(?P<id>[^/]+)'
```
Add a testcase for the `(?:[^/]+/)*` part | for episode in episodes:
video_id = str(episode['contentID'])
formats, subtitles = self._extract_m3u8_formats_and_subtitles(episode['streamURL'], video_id, 'mp4')
self._sort_formats(formats)
yield {
'id': video_id,
'title': episode... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 26 | Python | 0.714 | suggestion | 145 | 51 | 37 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
}
}, {
'url': 'https://www.freetv.com/peliculas/monstruoso/',
'md5': '509c15c68de41cb708d1f92d071f20aa',
'info_dict': {
'id': '377652',
'title': 'Monstruoso',
'description': 'md5:333fc19ee327b457b980e54a911ea4a3',
'ext': 'mp4',
... | In case we want to seperate the IE into single episode/series later, naming this FreeTvIE would provide some future-proofing. You can set an IE_NAME explaining it's series
```suggestion
class FreeTvIE(FreeTvBaseIE):
IE_NAME = 'freetv:series'
``` |
for episode in episodes:
video_id = str(episode['contentID'])
formats, subtitles = self._extract_m3u8_formats_and_subtitles(episode['streamURL'], video_id, 'mp4')
self._sort_formats(formats)
yield {
'id': video_id,
'title': episod... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 26 | Python | 0.786 | suggestion | 253 | 51 | 38 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
video_url, video_id, 'mp4', fatal=False)
self._sort_formats(formats)
entries.append({
'id': video_id,
'title': episode.get('fullTitle'),
'description': episode.get('description'),
... | same comments as FreeTvSeriesIE._VALID_URL | _TESTS = [{
'url': 'https://www.freetv.com/series/el-detective-l/',
'info_dict': {
'id': 'el-detective-l',
'title': 'El Detective L',
'description': 'md5:f9f1143bc33e9856ecbfcbfb97a759be'
},
'playlist_count': 24,
}, {
'url': 'https://ww... | @@ -0,0 +1,176 @@
+import re
+
+from .common import InfoExtractor
+from ..utils import (
+ determine_ext,
+ ExtractorError,
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata,
+)
+
+
+class FreeTvBaseIE(InfoExtractor):
+ def _get_api_response(self, content_id, postdata, resource_typ... | yt_dlp/extractor/freetv.py | 26 | Python | 0.071 | suggestion | 42 | 51 | 51 | false | [freetv] Add an extractor for freetv.com | 3,587 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | elyse0 |
if not video_id:
video_id = embed_id or self._html_search_regex(
rf'src="https?://{host}/media/embed.*(?:\?|&)key=([0-9a-f]+)&?',
webpage, 'video_id')
# Title, description from page meta wouldn't be correct if the video is embedded
# so separating nor... | ```suggestion
if isinstance(e.cause, compat_HTTPError) and e.cause.code != 404:
raise
```
avoids `pass` | 'display_id': 'Preisverleihung-Produkte-des-Jahres-2022',
'ext': 'mp4',
},
},
{
'url': 'https://videocampus.sachsen.de/media/embed?key=fc99c527e4205b121cb7c74433469262',
'info_dict': {
'id': 'fc99c527e4205b121cb7c7443346... | @@ -78,18 +109,45 @@ class VideocampusSachsenEmbedIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
+ host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
+ 'host', 'id', 'tmp_id', 'display_id', 'embed_id')
+ webpa... | yt_dlp/extractor/videocampus_sachsen.py | 26 | Python | 0.929 | suggestion | 135 | 39 | 51 | false | [Vimp] Rename, improve extractor | 3,604 | yt-dlp/yt-dlp | 132,642 | Python | sulyi | FestplattenSchnitzel |
'info_dict': {
'id': 'fc99c527e4205b121cb7c74433469262',
'title': 'Was ist selbstgesteuertes Lernen?',
'ext': 'mp4',
},
}
]
def _real_extract(self, url):
host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(... | ```suggestion
description = self._html_search_meta(('og:description', 'twitter:description', 'description'),
webpage, default=None)
```
too long line
| 'id': '0183356e41af7bfb83d7667b20d9b6a3',
'title': 'Présentation de la Faculté de droit et des sciences politiques - Journée portes ouvertes 2021/22',
'description': 'md5:508958bd93e0ca002ac731d94182a54f',
'display_id': 'Presentation-de-la-Faculte-de-droit... | @@ -78,18 +109,45 @@ class VideocampusSachsenEmbedIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
+ host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
+ 'host', 'id', 'tmp_id', 'display_id', 'embed_id')
+ webpa... | yt_dlp/extractor/videocampus_sachsen.py | 26 | Python | 0.786 | refactor | 217 | 51 | 51 | false | [Vimp] Rename, improve extractor | 3,604 | yt-dlp/yt-dlp | 132,642 | Python | sulyi | FestplattenSchnitzel |
'ext': 'mp4',
}
},
{
'url': 'https://videocampus.sachsen.de/media/embed?key=fc99c527e4205b121cb7c74433469262',
'info_dict': {
'id': 'fc99c527e4205b121cb7c74433469262',
'title': 'Was ist selbstgesteuertes Lernen?',
... | ```suggestion
if not (display_id or tmp_id):
# Title, description from embedded page's meta wouldn't be correct
```
makes it clear which path is embedded | },
{
'url': 'https://www2.univ-sba.dz/video/Presentation-de-la-Faculte-de-droit-et-des-sciences-politiques-Journee-portes-ouvertes-202122/0183356e41af7bfb83d7667b20d9b6a3',
'info_dict': {
'url': 'https://www2.univ-sba.dz/getMedium/0183356e41af7bfb83d7667b20d9b6a3.... | @@ -78,18 +109,45 @@ class VideocampusSachsenEmbedIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
+ host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
+ 'host', 'id', 'tmp_id', 'display_id', 'embed_id')
+ webpa... | yt_dlp/extractor/videocampus_sachsen.py | 26 | Python | 0.714 | suggestion | 177 | 51 | 51 | false | [Vimp] Rename, improve extractor | 3,604 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | FestplattenSchnitzel |
},
}
]
def _real_extract(self, url):
host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
'host', 'id', 'tmp_id', 'display_id', 'embed_id')
webpage = self._download_webpage(url, video_id or tmp_id, fatal=False) or ''
if not vi... | ```suggestion
formats, subtitles = [], {}
``` | 'ext': 'mp4',
}
},
{
'url': 'https://vimp.weka-fachmedien.de/video/Preisverleihung-Produkte-des-Jahres-2022/c8816f1cc942c12b6cce57c835cffd7c',
'info_dict': {
'id': 'c8816f1cc942c12b6cce57c835cffd7c',
'title': 'Preisverle... | @@ -78,18 +109,45 @@ class VideocampusSachsenEmbedIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
+ host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
+ 'host', 'id', 'tmp_id', 'display_id', 'embed_id')
+ webpa... | yt_dlp/extractor/videocampus_sachsen.py | 26 | Python | 0.571 | suggestion | 55 | 48 | 51 | false | [Vimp] Rename, improve extractor | 3,604 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | FestplattenSchnitzel |
rf'src="https?://{host}/media/embed.*(?:\?|&)key=([0-9a-f]+)&?',
webpage, 'video_id')
# Title, description from page meta wouldn't be correct if the video is embedded
# so separating normal and embedded extraction
if not (display_id or tmp_id):
title ... | is this better than other formats? Since no metadata is available, yt-dlp will assume it's the worst format by default. You can set a `'quality': 1` to tell yt-dlp that the format is better than others. (Ignore this if my assumption is wrong)
btw, u don't need to set ext=mp4. yt-dlp will see the URL and determine it... | },
},
{
'url': 'https://videocampus.sachsen.de/media/embed?key=fc99c527e4205b121cb7c74433469262',
'info_dict': {
'id': 'fc99c527e4205b121cb7c74433469262',
'title': 'Was ist selbstgesteuertes Lernen?',
'ext': 'mp4',
... | @@ -78,18 +109,45 @@ class VideocampusSachsenEmbedIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
+ host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
+ 'host', 'id', 'tmp_id', 'display_id', 'embed_id')
+ webpa... | yt_dlp/extractor/videocampus_sachsen.py | 26 | Python | 0.643 | bug | 334 | 37 | 51 | false | [Vimp] Rename, improve extractor | 3,604 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | FestplattenSchnitzel |
def _real_extract(self, url):
host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
'host', 'id', 'tmp_id', 'display_id', 'embed_id')
webpage = self._download_webpage(url, video_id or tmp_id, fatal=False) or ''
if not video_id:
video_id = e... | ```suggestion
video_id, 'mp4', m3u8_id='hls', fatal=True)
```
it's the default | 'url': 'https://vimp.weka-fachmedien.de/video/Preisverleihung-Produkte-des-Jahres-2022/c8816f1cc942c12b6cce57c835cffd7c',
'info_dict': {
'id': 'c8816f1cc942c12b6cce57c835cffd7c',
'title': 'Preisverleihung »Produkte des Jahres 2022«',
'description':... | @@ -78,18 +109,45 @@ class VideocampusSachsenEmbedIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
+ host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
+ 'host', 'id', 'tmp_id', 'display_id', 'embed_id')
+ webpa... | yt_dlp/extractor/videocampus_sachsen.py | 26 | Python | 0.571 | suggestion | 97 | 44 | 51 | false | [Vimp] Rename, improve extractor | 3,604 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | FestplattenSchnitzel |
'ext': 'mp4',
}
},
{
'url': 'https://videocampus.sachsen.de/media/embed?key=fc99c527e4205b121cb7c74433469262',
'info_dict': {
'id': 'fc99c527e4205b121cb7c74433469262',
'title': 'Was ist selbstgesteuertes Lernen?',
... | ```suggestion
title = self._html_search_regex(r'<img[^>]* title="([^"<]+)"', webpage, 'title', fatal=False)
``` | },
{
'url': 'https://www2.univ-sba.dz/video/Presentation-de-la-Faculte-de-droit-et-des-sciences-politiques-Journee-portes-ouvertes-202122/0183356e41af7bfb83d7667b20d9b6a3',
'info_dict': {
'url': 'https://www2.univ-sba.dz/getMedium/0183356e41af7bfb83d7667b20d9b6a3.... | @@ -78,18 +109,41 @@ class VideocampusSachsenEmbedIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
+ host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
+ 'host', 'id', 'tmp_id', 'display_id', 'embed_id')
+ webpa... | yt_dlp/extractor/videocampus_sachsen.py | 26 | Python | 0.714 | suggestion | 125 | 51 | 51 | false | [Vimp] Rename, improve extractor | 3,604 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | FestplattenSchnitzel |
{
'url': 'https://videocampus.sachsen.de/media/embed?key=fc99c527e4205b121cb7c74433469262',
'info_dict': {
'id': 'fc99c527e4205b121cb7c74433469262',
'title': 'Was ist selbstgesteuertes Lernen?',
'ext': 'mp4',
},
}
]
... | why default=None instead of fatal=False? | 'info_dict': {
'url': 'https://www2.univ-sba.dz/getMedium/0183356e41af7bfb83d7667b20d9b6a3.mp4',
'id': '0183356e41af7bfb83d7667b20d9b6a3',
'title': 'Présentation de la Faculté de droit et des sciences politiques - Journée portes ouvertes 2021/22',
... | @@ -78,18 +109,41 @@ class VideocampusSachsenEmbedIE(InfoExtractor):
]
def _real_extract(self, url):
- video_id = self._match_id(url)
+ host, video_id, tmp_id, display_id, embed_id = self._match_valid_url(url).group(
+ 'host', 'id', 'tmp_id', 'display_id', 'embed_id')
+ webpa... | yt_dlp/extractor/videocampus_sachsen.py | 26 | Python | 0.143 | question | 40 | 50 | 51 | false | [Vimp] Rename, improve extractor | 3,604 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | FestplattenSchnitzel |
'thumbnail': r're:^https?://.+\.jpg',
'comment_count': int,
'duration': 18014,
'play_count': int,
'view_count': int,
'timestamp': 1611694774,
'like_count': int,
'uploader': 'Fernanda Rivas🎶',
'uploader_id': 'fer... | ```suggestion
self._search_regex(r'window\.data\s=\s({.+?});', webpage, 'video info'),
``` | 'url': 'https://likee.video/v/k6QcOp',
'info_dict': {
'id': 'k6QcOp',
'ext': 'mp4',
'title': '#AguaChallenge tú ya lo intentaste?😱🤩',
'description': 'md5:b0cc462689d4ff2b624daa4dba7640d9',
'thumbnail': r're:^https?://.+\.jpg',
... | @@ -0,0 +1,185 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import traverse_obj, ExtractorError, js_to_json, int_or_none, str_or_none, parse_iso8601
+
+
+class LikeeIE(InfoExtractor):
+ IE_NAME = 'likee'
+ _VALID_URL = r'(?x)https?://(www\.)?likee\.video/(?:(?P<channel_name>[^/]+)/video/|v/)... | yt_dlp/extractor/likee.py | 26 | Python | 0.714 | suggestion | 104 | 51 | 51 | false | [Likee] Add new extractor | 3,625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
info = self._parse_json(
self._search_regex(r'window\.data\s=\s(\{.*\})\;', webpage, 'video info'),
video_id, transform_source=js_to_json)
vide... | ```suggestion
'title': info.get('msgText')',
``` | }, {
'url': 'https://www.likee.video/@649222262/video/7093167848050058862',
'only_matching': True,
}, {
'url': 'https://www.likee.video/v/k6QcOp',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._downl... | @@ -0,0 +1,185 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import traverse_obj, ExtractorError, js_to_json, int_or_none, str_or_none, parse_iso8601
+
+
+class LikeeIE(InfoExtractor):
+ IE_NAME = 'likee'
+ _VALID_URL = r'(?x)https?://(www\.)?likee\.video/(?:(?P<channel_name>[^/]+)/video/|v/)... | yt_dlp/extractor/likee.py | 26 | Python | 0.571 | suggestion | 62 | 51 | 51 | false | [Likee] Add new extractor | 3,625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
def _entries(self, user_name, user_id):
last_post_id = ''
while True:
user_videos = self._download_json(
self._API_GET_USER_VIDEO, user_name,
data=json.dumps({
'uid': user_id,
'count': self._PAGE_SIZE,
... | ```suggestion
self._search_regex(r'window\.data\s*=\s*({.+?});', webpage, 'user info'),
``` | _API_GET_USER_VIDEO = 'https://api.like-video.com/likee-activity-flow-micro/videoApi/getUserVideo'
def _entries(self, user_name, user_id):
last_post_id = ''
while True:
user_videos = self._download_json(
self._API_GET_USER_VIDEO, user_name,
data=json.... | @@ -181,5 +180,13 @@ def _real_extract(self, url):
break
last_post_id = items[-1]['postId']
for item in items:
- entries.append(self.url_result(f'https://likee.video/{user_name}/video/{item["postId"]}'))
- return self.playlist_result(entries, user_id, tra... | yt_dlp/extractor/likee.py | 26 | Python | 0.786 | suggestion | 105 | 30 | 31 | false | [Likee] Add new extractor | 3,625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
'only_matching': True,
}, {
'url': 'https://www.likee.video/v/k6QcOp',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
info = self._parse_json(
self._search_reg... | ```suggestion
'format_id': 'mp4-without-watermark',
'url': video_url.replace('_4', ''),
'height': info.get('video_height'),
'width': info.get('video_width'),
'quality': 1,
}]
```
since they have same width/height, _sort_formats wouldn't know ho... | 'only_matching': True,
}, {
'url': 'https://www.likee.video/v/k6QcOp',
'only_matching': True,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
info = self._parse_json(
self._search_reg... | @@ -0,0 +1,192 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ js_to_json,
+ parse_iso8601,
+ str_or_none,
+ traverse_obj,
+)
+
+
+class LikeeIE(InfoExtractor):
+ IE_NAME = 'likee'
+ _VALID_URL = r'(?x)https?://(www\.)?likee\.video/(?:(?P<channel_name>[^... | yt_dlp/extractor/likee.py | 26 | Python | 0.857 | suggestion | 343 | 51 | 51 | false | [Likee] Add new extractor | 3,625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
'title': 'may_hmoob',
},
'playlist_mincount': 80,
}]
_PAGE_SIZE = 50
_API_GET_USER_VIDEO = 'https://api.like-video.com/likee-activity-flow-micro/videoApi/getUserVideo'
def _entries(self, user_name, user_id):
last_post_id = ''
while True:
user_vide... | ```suggestion
if not items:
break
for item in items:
last_post_id = item['postId']
yield self.url_result(f'https://likee.video/{user_name}/video/{last_post_id}')
``` | 'id': '2943949041',
'title': 'may_hmoob',
},
'playlist_mincount': 80,
}]
_PAGE_SIZE = 50
_API_GET_USER_VIDEO = 'https://api.like-video.com/likee-activity-flow-micro/videoApi/getUserVideo'
def _entries(self, user_name, user_id):
last_post_id = ''
w... | @@ -0,0 +1,192 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ js_to_json,
+ parse_iso8601,
+ str_or_none,
+ traverse_obj,
+)
+
+
+class LikeeIE(InfoExtractor):
+ IE_NAME = 'likee'
+ _VALID_URL = r'(?x)https?://(www\.)?likee\.video/(?:(?P<channel_name>[^... | yt_dlp/extractor/likee.py | 26 | Python | 0.857 | suggestion | 243 | 36 | 37 | false | [Likee] Add new extractor | 3,625 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
def _entries(self, asin):
season_info = self._call_api(
asin,
data={
'operationName': 'getSeasons',
'variables': {
'episodeOrSeasonOrSeriesId': asin,
},
'query': '''
query getSeasons($sessionIdToken:... | ```suggestion
yield self.url_result(f'amazonminitv:season:{season["seasonId"]}', AmazonMiniTVSeasonIE, season['seasonId'])
```
Series code is not working. This change will fix it | seasons {
seasonId
}
}
}
'''
def _entries(self, asin):
season_info = self._call_api(
asin,
data={
'operationName': 'getSeasons',
'variables': {
'episodeOrSeasonOrSeriesId': asin,
},
'... | @@ -0,0 +1,327 @@
+import json
+
+from .common import InfoExtractor
+from ..utils import ExtractorError, int_or_none, traverse_obj, try_get
+
+
+class AmazonMiniTVIE(InfoExtractor):
+ _VALID_URL = r'(?:https?://(?:www\.)?amazon\.in/minitv/tp/|amazonminitv:(?:amzn1\.dv\.gti\.)?)(?P<id>[a-f0-9-]+)'
+ _HEADERS = {
+... | yt_dlp/extractor/amazonminitv.py | 26 | Python | 0.786 | suggestion | 195 | 31 | 26 | false | [amazonminitv] Add extractor | 3,628 | yt-dlp/yt-dlp | 132,642 | Python | GautamMKGarg | ghost |
f'https://statics.tver.jp/content/episode/{video_id}.json', video_id,
query={'v': '5'}, headers={
'Origin': 'https://tver.jp',
'Referer': 'https://tver.jp/',
})
p_id = video_info['video']['accountID']
r_id = traverse_obj(video_info, ('v... | ```suggestion
episode = strip_or_none(additional_content_info.get('title'))
```
or is there a reason you specifically want `rstrip`? | video_info = self._download_json(
f'https://statics.tver.jp/content/episode/{video_id}.json', video_id,
query={'v': '5'}, headers={
'Origin': 'https://tver.jp',
'Referer': 'https://tver.jp/',
})
p_id = video_info['video']['accountID']
... | @@ -78,14 +76,27 @@ def _real_extract(self, url):
'x-tver-platform-type': 'web'
})
+ additional_content_info = traverse_obj(
+ additional_info, ('result', 'episode', 'content'),
+ get_all=False) or {}
+ episode = try_get(additional_content_info, lambda... | yt_dlp/extractor/tver.py | 26 | Python | 0.714 | question | 143 | 47 | 47 | false | [TVer] improve extraction | 3,634 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
video_info = self._download_json(
f'https://statics.tver.jp/content/episode/{video_id}.json', video_id,
query={'v': '5'}, headers={
'Origin': 'https://tver.jp',
'Referer': 'https://tver.jp/',
})
p_id = video_info['video']['accountID']
... | ```suggestion
additional_content_info = traverse_obj(
additional_info, ('result', 'episode', 'content'), get_all=False) or {}
``` | webpage, 'url regex'))
video_info = self._download_json(
f'https://statics.tver.jp/content/episode/{video_id}.json', video_id,
query={'v': '5'}, headers={
'Origin': 'https://tver.jp',
'Referer': 'https://tver.jp/',
})
p_... | @@ -78,14 +76,27 @@ def _real_extract(self, url):
'x-tver-platform-type': 'web'
})
+ additional_content_info = traverse_obj(
+ additional_info, ('result', 'episode', 'content'),
+ get_all=False) or {} | yt_dlp/extractor/tver.py | 26 | Python | 0.714 | suggestion | 152 | 48 | 48 | false | [TVer] improve extraction | 3,634 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'Referer': 'https://tver.jp/',
})
p_id = video_info['video']['accountID']
r_id = traverse_obj(video_info, ('video', ('videoRefID', 'videoID')), get_all=False)
if not r_id:
raise ExtractorError('Failed to extract reference ID for Brightcove')
if not... | ```suggestion
join_nonempty(series, episode, delim=' ').rstrip()
``` | 'Origin': 'https://tver.jp',
'Referer': 'https://tver.jp/',
})
p_id = video_info['video']['accountID']
r_id = traverse_obj(video_info, ('video', ('videoRefID', 'videoID')), get_all=False)
if not r_id:
raise ExtractorError('Failed to extract... | @@ -78,14 +76,27 @@ def _real_extract(self, url):
'x-tver-platform-type': 'web'
})
+ additional_content_info = traverse_obj(
+ additional_info, ('result', 'episode', 'content'),
+ get_all=False) or {}
+ episode = try_get(additional_content_info, lambda... | yt_dlp/extractor/tver.py | 26 | Python | 0.571 | suggestion | 82 | 44 | 44 | false | [TVer] improve extraction | 3,634 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
video_id, fatal=False,
query={
'platform_uid': self._PLATFORM_UID,
'platform_token': self._PLATFORM_TOKEN,
}, headers={
'x-tver-platform-type': 'web'
})
additional_content_info = traverse_obj(
additional... | use join_nonempty. This will crash if any of these is `None` | f'https://platform-api.tver.jp/service/api/v1/callEpisode/{video_id}?require_data=mylist,later[epefy106ur],good[epefy106ur],resume[epefy106ur]',
video_id, fatal=False,
query={
'platform_uid': self._PLATFORM_UID,
'platform_token': self._PLATFORM_TOKEN,
... | @@ -78,14 +76,27 @@ def _real_extract(self, url):
'x-tver-platform-type': 'web'
})
+ additional_content_info = traverse_obj(
+ additional_info, ('result', 'episode', 'content'),
+ get_all=False) or {}
+ episode = try_get(additional_content_info, lambda... | yt_dlp/extractor/tver.py | 26 | Python | 0.429 | bug | 60 | 33 | 33 | false | [TVer] improve extraction | 3,634 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
import re
import urllib
from .common import InfoExtractor
from ..utils import (
int_or_none,
mimetype2ext,
remove_end,
url_or_none,
urljoin,
unified_strdate,
strip_or_none,
)
class IwaraBaseIE(InfoExtractor):
_BASE_REGEX = r'(?P<base_url>https?://(?:www\.|ecchi\.)?iwara\.tv)'
def... | ```suggestion
_VALID_URL = fr'{IwaraBaseIE._BASE_REGEX}/videos/(?P<id>[a-zA-Z0-9]+)'
```
same below | import re
import urllib
from .common import InfoExtractor
from ..utils import (
int_or_none,
mimetype2ext,
remove_end,
url_or_none,
urljoin,
unified_strdate,
strip_or_none,
)
class IwaraBaseIE(InfoExtractor):
_BASE_REGEX = r'(?P<base_url>https?://(?:www\.|ecchi\.)?iwara\.tv)'
def... | @@ -1,19 +1,28 @@
import re
+import urllib
from .common import InfoExtractor
-from ..compat import compat_urllib_parse_urlparse
from ..utils import (
int_or_none,
mimetype2ext,
remove_end,
url_or_none,
+ urljoin,
unified_strdate,
strip_or_none,
)
-class IwaraIE(InfoExtractor):... | yt_dlp/extractor/iwara.py | 25 | Python | 0.714 | suggestion | 106 | 50 | 50 | false | [iwara] Add extractors | 3,639 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
'upload_date': '20150828',
'description': 'md5:1d4905ce48c66c9299c617f08e106e0f',
},
}, {
'url': 'http://ecchi.iwara.tv/videos/Vb4yf2yZspkzkBO',
'md5': '7e5f1f359cd51a027ba4a7b7710a50f0',
'info_dict': {
'id': '0B1LvuHnL-sRFNXB1WHNqbGw4SXc',
... | This is using `urlh.geturl()` in order to account for any redirects. Change this only if you are sure this isn't needed | 'upload_date': '20150828',
'description': 'md5:1d4905ce48c66c9299c617f08e106e0f',
},
}, {
'url': 'http://ecchi.iwara.tv/videos/Vb4yf2yZspkzkBO',
'md5': '7e5f1f359cd51a027ba4a7b7710a50f0',
'info_dict': {
'id': '0B1LvuHnL-sRFNXB1WHNqbGw4SXc',
... | @@ -56,9 +65,9 @@ class IwaraIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
- webpage, urlh = self._download_webpage_handle(url, video_id)
+ webpage = self._download_webpage(url, video_id)
- hostname = compat_urllib_parse_urlparse(urlh.geturl()).ho... | yt_dlp/extractor/iwara.py | 26 | Python | 0.571 | suggestion | 119 | 51 | 51 | false | [iwara] Add extractors | 3,639 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | ghost |
"uploader": "The Mac Life",
"description": "md5:56e6009bbc3d12498e10d08a8e1f1c69",
"upload_date": "20201119",
"uploader_id": "TheMacLife",
"timestamp": 1605800556,
"thumbnail": "https://pbs.twimg.com/media/EnMmfT8XYAExgxJ.jp... | ```suggestion
match_obj = re.search(r'\.cueVideoById\(\s*(?P<quote>[\'"])(?P<id>.*?)(?P=quote)', webpage)
``` | "tags": [],
"comment_count": int,
},
},
]
def _real_extract(self, url):
webpage = self._download_webpage(url, url)
jsonld = self._search_json_ld(webpage, url)
if not jsonld or "url" not in jsonld:
# try to extract from YouT... | @@ -133,7 +181,9 @@ def _real_extract(self, url):
if not jsonld or "url" not in jsonld:
# try to extract from YouTube Player API
# see https://developers.google.com/youtube/iframe_api_reference#Video_Queueing_Functions
- match_obj = re.search(r'\.cueVideoById\(\s*(?P<quote>... | yt_dlp/extractor/tmz.py | 26 | Python | 0.714 | suggestion | 123 | 46 | 32 | false | Update tmz.com extractor tests | 3,654 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | diegorodriguezv |
"repost_count": int,
"tags": [],
"comment_count": int,
},
},
]
def _real_extract(self, url):
webpage = self._download_webpage(url, url)
jsonld = self._search_json_ld(webpage, url)
if not jsonld or "url" not in jsonld:
... | ```suggestion
blockquote_el)
``` | import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
get_element_by_attribute,
)
class TMZIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?tmz\.com/.*"
_TESTS = [
{
"url": "http://www.tmz.com/videos/0-cegprt2p/",
"info_dict": {
... | @@ -142,7 +192,8 @@ def _real_extract(self, url):
if blockquote_el:
matches = re.findall(
r'<a[^>]+href=\s*(?P<quote>[\'"])(?P<link>.*?)(?P=quote)',
- blockquote_el)
+ blockquote_el,
+ ) | yt_dlp/extractor/tmz.py | 26 | Python | 0.571 | suggestion | 54 | 36 | 192 | false | Update tmz.com extractor tests | 3,654 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | diegorodriguezv |
"uploader_id": "ESNEWS",
"uploader_url": "http://www.youtube.com/user/ESNEWS",
"like_count": int,
"channel_id": "UCI-Oq7oFGakzSzHFlTtsUsQ",
"channel": "ESNEWS",
"view_count": int,
"duration": 225,
... | ```suggestion
"tags": "count:10",
``` | "uploader_id": "ESNEWS",
"uploader_url": "http://www.youtube.com/user/ESNEWS",
"like_count": int,
"channel_id": "UCI-Oq7oFGakzSzHFlTtsUsQ",
"channel": "ESNEWS",
"view_count": int,
"duration": 225,
... | @@ -108,21 +122,55 @@ class TMZIE(InfoExtractor):
"title": "SICK LAMBO GERVONTA DAVIS IN HIS NEW RIDE RIGHT AFTER KO AFTER LEO EsNews Boxing",
"uploader": "ESNEWS",
"description": "md5:49675bc58883ccf80474b8aa701e1064",
- "upload_date": "20201101",
+ ... | yt_dlp/extractor/tmz.py | 26 | Python | 0.571 | suggestion | 55 | 51 | 51 | false | Update tmz.com extractor tests | 3,654 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | diegorodriguezv |
if playlist_url in found:
continue
else:
found.add(playlist_url)
time_to_skip = None if is_onair else cursor - ft
domain = urllib.parse.urlparse(playlist_url).netloc
subformats = self._extract_m3u8_formats(
pla... | why can't we just automatically re-authenticate + re-extract here? That's what other similar extractors do |
time_to_skip = None if is_onair else cursor - ft
domain = urllib.parse.urlparse(playlist_url).netloc
subformats = self._extract_m3u8_formats(
playlist_url, video_id, ext='m4a',
live=True, fatal=False, m3u8_id=domain,
note=f'Downloadin... | @@ -112,22 +112,26 @@ def _extract_formats(self, video_id, station, is_onair, ft, cursor, auth_token,
time_to_skip = None if is_onair else cursor - ft
+ domain = urllib.parse.urlparse(playlist_url).netloc
subformats = self._extract_m3u8_formats(
playlist_url, vi... | yt_dlp/extractor/radiko.py | 26 | Python | 0.429 | security | 106 | 51 | 51 | false | [radiko] Fix extractor | 3,655 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
if service_mobj:
url = smuggle_url(url, {'service_url': service_mobj.group('id')})
urls.append(url)
return urls
def _kaltura_api_call(self, video_id, actions, service_url=None, *args, **kwargs):
params = actions[0]
params.update({i: a for i, a in enum... | why not just
```suggestion
data[1] = data[1]['objects'][0]
```
OR
```suggestion
data[1] = traverse_obj(data, (1, 'objects', 0))
```
It seems weird to me that the access till `objects` is fatal, but then the `0` is non-fatal | if service_mobj:
url = smuggle_url(url, {'service_url': service_mobj.group('id')})
urls.append(url)
return urls
def _kaltura_api_call(self, video_id, actions, service_url=None, *args, **kwargs):
params = actions[0]
params.update({i: a for i, a in enum... | @@ -169,30 +171,36 @@ def _extract_urls(webpage):
def _kaltura_api_call(self, video_id, actions, service_url=None, *args, **kwargs):
params = actions[0]
- if len(actions) > 1:
- for i, a in enumerate(actions[1:], start=1):
- for k, v in a.items():
- pa... | yt_dlp/extractor/kaltura.py | 26 | Python | 0.786 | suggestion | 249 | 51 | 51 | false | [kaltura] update API call | 3,657 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | flashdagger |
# coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..utils import float_or_none, try_get, str_to_int, unified_timestamp, merge_dicts
from ..compat import compat_str
from .common import InfoExtractor
class PodchaserIE(InfoExtractor):
_VALID_URL = r'''(?x)
https?://(?:www\.)?... | some of the brackets and indentation don't make sense | import functools
import json
from .common import InfoExtractor
from ..utils import (
OnDemandPagedList,
float_or_none,
str_or_none,
str_to_int,
traverse_obj,
unified_timestamp,
)
class PodchaserIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?podchaser\.com/podcasts/[\w-]+-(?P<podcast... | @@ -0,0 +1,114 @@
+# coding: utf-8
+from __future__ import unicode_literals
+import json
+import re
+from ..utils import float_or_none, try_get, str_to_int, unified_timestamp, merge_dicts
+from ..compat import compat_str
+from .common import InfoExtractor
+
+
+class PodchaserIE(InfoExtractor):
+ _VALID_URL = r'''(?x... | yt_dlp/extractor/podchaser.py | 16 | Python | 0.214 | style | 53 | 41 | 41 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | connercsbn |
'duration': 3708,
'timestamp': 1636531259,
'upload_date': '20211110',
'rating': 4.0
}
}, {
'url': 'https://www.podchaser.com/podcasts/the-bone-zone-28853',
'info_dict': {
'id': '28853',
'title': 'The Bone Zone',
... | ```suggestion
audio_id, podcast_id = self._match_valid_url(url).group('id', 'podcast_id')
``` | 'duration': 3708,
'timestamp': 1636531259,
'upload_date': '20211110',
'rating': 4.0
}
}, {
'url': 'https://www.podchaser.com/podcasts/the-bone-zone-28853',
'info_dict': {
'id': '28853',
'title': 'The Bone Zone',
... | @@ -0,0 +1,114 @@
+# coding: utf-8
+from __future__ import unicode_literals
+import json
+import re
+from ..utils import float_or_none, try_get, str_to_int, unified_timestamp, merge_dicts
+from ..compat import compat_str
+from .common import InfoExtractor
+
+
+class PodchaserIE(InfoExtractor):
+ _VALID_URL = r'''(?x... | yt_dlp/extractor/podchaser.py | 26 | Python | 0.857 | suggestion | 103 | 51 | 51 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | connercsbn |
'info_dict': {
'id': '28853',
'title': 'The Bone Zone',
'description': 'Podcast by The Bone Zone',
},
'playlist_count': 275
}, {
'url': 'https://www.podchaser.com/podcasts/sean-carrolls-mindscape-scienc-699349/episodes',
'info_dict': {
... | This is better as 2 extractors imo | 'info_dict': {
'id': '28853',
'title': 'The Bone Zone',
'description': 'Podcast by The Bone Zone',
},
'playlist_count': 275
}, {
'url': 'https://www.podchaser.com/podcasts/sean-carrolls-mindscape-scienc-699349/episodes',
'info_dict': {
... | @@ -0,0 +1,114 @@
+# coding: utf-8
+from __future__ import unicode_literals
+import json
+import re
+from ..utils import float_or_none, try_get, str_to_int, unified_timestamp, merge_dicts
+from ..compat import compat_str
+from .common import InfoExtractor
+
+
+class PodchaserIE(InfoExtractor):
+ _VALID_URL = r'''(?x... | yt_dlp/extractor/podchaser.py | 26 | Python | 0.143 | refactor | 34 | 51 | 51 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | connercsbn |
"sort_order": "SORT_ORDER_RECENT",
"filters": {
"podcast_id": podcast_id
}, "options": {}
}).encode())
curr_episodes = curr_episodes_data.get('entities') or []
if len(c... | ```suggestion
'categories': traverse_obj(podcast_data, (('summary', None), 'categories', ..., 'text'))
``` | import functools
import json
from .common import InfoExtractor
from ..utils import (
OnDemandPagedList,
float_or_none,
str_or_none,
str_to_int,
traverse_obj,
unified_timestamp,
)
class PodchaserIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?podchaser\.com/podcasts/[\w-]+-(?P<podcast... | @@ -0,0 +1,114 @@
+# coding: utf-8
+from __future__ import unicode_literals
+import json
+import re
+from ..utils import float_or_none, try_get, str_to_int, unified_timestamp, merge_dicts
+from ..compat import compat_str
+from .common import InfoExtractor
+
+
+class PodchaserIE(InfoExtractor):
+ _VALID_URL = r'''(?x... | yt_dlp/extractor/podchaser.py | 26 | Python | 0.857 | suggestion | 120 | 40 | 98 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | connercsbn |
def _extract_episode(self, podcast, episode):
return {
'id': str(episode.get('id')),
'title': episode.get('title'),
'description': episode.get('description'),
'url': episode.get('audio_url'),
'thumbnail': episode.get('image_url'),
'dur... | Regarding the errors, would this be a good fix?
`r'(?P<id>\d+).+[^\d]$'` | 'url': 'https://www.podchaser.com/podcasts/the-bone-zone-28853',
'info_dict': {
'id': '28853',
'title': 'The Bone Zone',
'description': 'Podcast by The Bone Zone',
},
'playlist_count': 275
}, {
'url': 'https://www.podchaser.com/podcasts/sea... | @@ -33,7 +31,34 @@ class PodchaserIE(InfoExtractor):
'upload_date': '20211110',
'rating': 4.0
}
- }, {
+ }]
+
+ def _extract_episode(self, podcast, episode):
+ return {
+ 'id': str(episode.get('id')),
+ 'title': episode.get('title'),
+ ... | yt_dlp/extractor/podchaser.py | 26 | Python | 0.5 | suggestion | 73 | 51 | 51 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | connercsbn | connercsbn |
}
}]
def _extract_episode(self, podcast, episode):
return {
'id': str(episode.get('id')),
'title': episode.get('title'),
'description': episode.get('description'),
'url': episode.get('audio_url'),
'thumbnail': episode.get('image_url'),... | Extractors should only inherit from a base extractor. Like:
```py
class PodchaserBaseIE(InfoExtractor):
def _extract_episode(...): ...
class PodchaserIE(PodchaserBaseIE):
...
class PodchaserFeedIE(PodchaserBaseIE):
...
```
But here, inheritence isn't even really needed. `_extract_episode`, `_... | }
}, {
'url': 'https://www.podchaser.com/podcasts/the-bone-zone-28853',
'info_dict': {
'id': '28853',
'title': 'The Bone Zone',
'description': 'Podcast by The Bone Zone',
},
'playlist_count': 275
}, {
'url': 'https://www.podchas... | @@ -0,0 +1,109 @@
+import functools
+import json
+from .common import InfoExtractor
+from ..utils import (
+ float_or_none,
+ OnDemandPagedList,
+ str_to_int,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class PodchaserIE(InfoExtractor):
+ IE_NAME = 'Podchaser'
+ _VALID_URL_BASE = r'https?://(?:www\... | yt_dlp/extractor/podchaser.py | 26 | Python | 0.857 | refactor | 425 | 51 | 51 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | connercsbn |
'description': 'Podcast by The Bone Zone',
},
'playlist_count': 275
}, {
'url': 'https://www.podchaser.com/podcasts/sean-carrolls-mindscape-scienc-699349/episodes',
'info_dict': {
'id': '699349',
'title': 'Sean Carroll\'s Mindscape: Science, Societ... | use fstrings instead of `+`. Same everywhere | }
def _call_api(self, path, *args, **kwargs):
return self._download_json(f'https://api.podchaser.com/{path}', *args, **kwargs)
def _fetch_page(self, podcast_id, podcast, page):
json_response = self._call_api(
'list/episode', podcast_id,
headers={'Content-Type': ... | @@ -0,0 +1,109 @@
+import functools
+import json
+from .common import InfoExtractor
+from ..utils import (
+ float_or_none,
+ OnDemandPagedList,
+ str_to_int,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class PodchaserIE(InfoExtractor):
+ IE_NAME = 'Podchaser'
+ _VALID_URL_BASE = r'https?://(?:www\... | yt_dlp/extractor/podchaser.py | 26 | Python | 0.286 | suggestion | 44 | 45 | 33 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | connercsbn |
'description': 'md5:2cbd8f4749891a84dc8235342e0b5ff1'
},
'playlist_mincount': 225
}]
_PAGE_SIZE = 100
def _fetch_page(self, podcast_id, podcast, page):
params = {
'start': page * self._PAGE_SIZE,
'count': self._PAGE_SIZE,
'sort_order':... | ```suggestion
podcast_id = self._match_id(url)
``` | import functools
import json
from .common import InfoExtractor
from ..utils import (
OnDemandPagedList,
float_or_none,
str_or_none,
str_to_int,
traverse_obj,
unified_timestamp,
)
class PodchaserIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?podchaser\.com/podcasts/[\w-]+-(?P<podcast... | @@ -0,0 +1,109 @@
+import functools
+import json
+from .common import InfoExtractor
+from ..utils import (
+ float_or_none,
+ OnDemandPagedList,
+ str_to_int,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class PodchaserIE(InfoExtractor):
+ IE_NAME = 'Podchaser'
+ _VALID_URL_BASE = r'https?://(?:www\... | yt_dlp/extractor/podchaser.py | 26 | Python | 0.714 | suggestion | 60 | 37 | 98 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | connercsbn |
'sort_order': 'SORT_ORDER_RECENT',
'filters': {
'podcast_id': podcast_id
},
'options': {}
}
json_response = self._download_json(
self._API_BASE + 'list/episode', podcast_id,
headers={'Content-Type': 'application/json... | ```suggestion
return self.playlist_result(
entries, str_or_none(podcast.get('id')), podcast.get('title'), podcast.get('description'))
``` | import functools
import json
from .common import InfoExtractor
from ..utils import (
OnDemandPagedList,
float_or_none,
str_or_none,
str_to_int,
traverse_obj,
unified_timestamp,
)
class PodchaserIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?podchaser\.com/podcasts/[\w-]+-(?P<podcast... | @@ -0,0 +1,109 @@
+import functools
+import json
+from .common import InfoExtractor
+from ..utils import (
+ float_or_none,
+ OnDemandPagedList,
+ str_to_int,
+ traverse_obj,
+ unified_timestamp
+)
+
+
+class PodchaserIE(InfoExtractor):
+ IE_NAME = 'Podchaser'
+ _VALID_URL_BASE = r'https?://(?:www\... | yt_dlp/extractor/podchaser.py | 26 | Python | 0.857 | suggestion | 160 | 27 | 98 | false | [Podchaser] Add extractor | 3,665 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | connercsbn |
'skip_download': 'm3u8',
},
}]
def _real_extract(self, url):
channel_id = self._match_id(url)
gg = self._download_json(f'https://api2.goodgame.ru/v2/streams/{channel_id}', channel_id)
title = traverse_obj(gg, ('channel', 'title'))
description = clean_html(t... | ```suggestion
formats, subtitles = self._extract_m3u8_formats_and_subtitles(
f'https://hls.goodgame.ru/manifest/{gg["id"]}_master.m3u8',
channel_id, 'mp4', m3u8_id='hls', live=True)
self._sort_formats(formats)
return {
'id': channel_id,
'f... | 'channel_url': 'https://goodgame.ru/channel/Pomi/',
'description': 'md5:4a87b775ee7b2b57bdccebe285bbe171',
'thumbnail': r're:^https?://.*\.jpg$',
'live_status': 'is_live',
'view_count': int,
},
'params': {'skip_download': 'm3u8'},
'skip... | @@ -0,0 +1,46 @@
+from .common import InfoExtractor
+from ..utils import clean_html, traverse_obj
+
+_GOODGAME_API = 'https://api2.goodgame.ru/v2'
+_GOODGAME_HLS = 'https://hls.goodgame.ru'
+
+
+class GoodGameIE(InfoExtractor):
+ IE_NAME = 'goodgame:stream'
+ _VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a... | yt_dlp/extractor/goodgame.py | 26 | Python | 0.857 | refactor | 634 | 27 | 39 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nevack |
from ..utils import clean_html, traverse_obj
class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
_TESTS = [{
'url': 'https://goodgame.ru/channel/Kochevnik',
'info_dict': {
'id': 'Kochevnik',
... | With `is_live` set to `True`, timestamp like `2022-05-11 15:54` is appended. | from ..utils import (
clean_html,
int_or_none,
str_or_none,
traverse_obj,
)
class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>\w+)'
_TESTS = [{
'url': 'https://goodgame.ru/channel/Pomi/#autoplay',
'info_dict': {... | @@ -0,0 +1,56 @@
+from .common import InfoExtractor
+from ..utils import clean_html, traverse_obj
+
+
+class GoodGameIE(InfoExtractor):
+ IE_NAME = 'goodgame:stream'
+ _VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
+ _TESTS = [{
+ 'url': 'https://goodgame.ru/channel/Kochevnik',
+ ... | yt_dlp/extractor/goodgame.py | 26 | Python | 0.357 | suggestion | 76 | 51 | 51 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | nevack | nevack |
class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
_TESTS = [{
'url': 'https://goodgame.ru/channel/Kochevnik',
'info_dict': {
'id': 'Kochevnik',
'ext': 'mp4',
'title': 'Кочетят... | Description is like 20 lines, so check only type | clean_html,
int_or_none,
str_or_none,
traverse_obj,
)
class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>\w+)'
_TESTS = [{
'url': 'https://goodgame.ru/channel/Pomi/#autoplay',
'info_dict': {
'id': 'po... | @@ -0,0 +1,56 @@
+from .common import InfoExtractor
+from ..utils import clean_html, traverse_obj
+
+
+class GoodGameIE(InfoExtractor):
+ IE_NAME = 'goodgame:stream'
+ _VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
+ _TESTS = [{
+ 'url': 'https://goodgame.ru/channel/Kochevnik',
+ ... | yt_dlp/extractor/goodgame.py | 26 | Python | 0.214 | suggestion | 48 | 51 | 51 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | nevack | nevack |
'url': 'https://goodgame.ru/channel/Kochevnik',
'info_dict': {
'id': 'Kochevnik',
'ext': 'mp4',
'title': 'Кочетятр',
'description': '',
'thumbnail': r're:^https?://.*\.jpg$',
'live_status': 'not_live',
},
'params': {... | ```suggestion
'params': {'skip_download': 'm3u8'},
'skip: 'No longer live',
``` |
class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>\w+)'
_TESTS = [{
'url': 'https://goodgame.ru/channel/Pomi/#autoplay',
'info_dict': {
'id': 'pomi',
'ext': 'mp4',
'title': r're:Reynor vs Spec... | @@ -0,0 +1,56 @@
+from .common import InfoExtractor
+from ..utils import clean_html, traverse_obj
+
+
+class GoodGameIE(InfoExtractor):
+ IE_NAME = 'goodgame:stream'
+ _VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
+ _TESTS = [{
+ 'url': 'https://goodgame.ru/channel/Kochevnik',
+ ... | yt_dlp/extractor/goodgame.py | 26 | Python | 0.571 | suggestion | 98 | 49 | 51 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nevack |
'url': 'https://goodgame.ru/channel/LampaRPG',
'info_dict': {
'id': 'LampaRPG',
'ext': 'mp4',
'title': r're:Рейтинговые герои.*$',
'description': str,
'thumbnail': r're:^https?://.*\.jpg$',
'live_status': 'is_live',
},
... | Does the videos have no unique id? This will cause all videos from a channel to have same id | 'thumbnail': r're:^https?://.*\.jpg$',
'live_status': 'is_live',
'view_count': int,
},
'params': {'skip_download': 'm3u8'},
'skip': 'May not be online',
}]
def _real_extract(self, url):
channel_name = self._match_id(url)
response = sel... | @@ -0,0 +1,56 @@
+from .common import InfoExtractor
+from ..utils import clean_html, traverse_obj
+
+
+class GoodGameIE(InfoExtractor):
+ IE_NAME = 'goodgame:stream'
+ _VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
+ _TESTS = [{
+ 'url': 'https://goodgame.ru/channel/Kochevnik',
+ ... | yt_dlp/extractor/goodgame.py | 26 | Python | 0.286 | suggestion | 92 | 35 | 37 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nevack |
'info_dict': {
'id': 'LampaRPG',
'ext': 'mp4',
'title': r're:Рейтинговые герои.*$',
'description': str,
'thumbnail': r're:^https?://.*\.jpg$',
'live_status': 'is_live',
},
'params': {
'skip_download': 'm3u8',
... | shouldn't this be `channel`? Does the video not have any title? | 'live_status': 'is_live',
'view_count': int,
},
'params': {'skip_download': 'm3u8'},
'skip': 'May not be online',
}]
def _real_extract(self, url):
channel_name = self._match_id(url)
response = self._download_json(f'https://api2.goodgame.ru/v2/stre... | @@ -0,0 +1,56 @@
+from .common import InfoExtractor
+from ..utils import clean_html, traverse_obj
+
+
+class GoodGameIE(InfoExtractor):
+ IE_NAME = 'goodgame:stream'
+ _VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
+ _TESTS = [{
+ 'url': 'https://goodgame.ru/channel/Kochevnik',
+ ... | yt_dlp/extractor/goodgame.py | 26 | Python | 0.429 | question | 63 | 34 | 36 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nevack |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
clean_html,
int_or_none,
traverse_obj,
)
class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
_TESTS = [{
'url': 'https://goodgame.ru/... | @pukkandan `live_status` takes precedence over `is_live` property? | from .common import InfoExtractor
from ..utils import (
clean_html,
int_or_none,
str_or_none,
traverse_obj,
)
class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>\w+)'
_TESTS = [{
'url': 'https://goodgame.ru/channel/Pomi/... | @@ -17,26 +18,26 @@ class GoodGameIE(InfoExtractor):
'title': r're:Рейтинговые герои \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
'description': 'md5:ca5faa69b5d9215afdc65caeca68e1f6',
'thumbnail': r're:^https?://.*\.jpg$',
- 'is_live': True, | yt_dlp/extractor/goodgame.py | 20 | Python | 0.357 | question | 66 | 45 | 45 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | nevack | nevack |
class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>[a-zA-Z0-9_]+)'
_TESTS = [{
'url': 'https://goodgame.ru/channel/LampaRPG',
'info_dict': {
'id': '156878',
'ext': 'mp4',
'title': r're:Рейтингов... | @pukkandan Shouldn't we use `response.get('id')` here? | class GoodGameIE(InfoExtractor):
IE_NAME = 'goodgame:stream'
_VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>\w+)'
_TESTS = [{
'url': 'https://goodgame.ru/channel/Pomi/#autoplay',
'info_dict': {
'id': 'pomi',
'ext': 'mp4',
'title': r're:Reynor vs Speci... | @@ -17,26 +18,26 @@ class GoodGameIE(InfoExtractor):
'title': r're:Рейтинговые герои \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
'description': 'md5:ca5faa69b5d9215afdc65caeca68e1f6',
'thumbnail': r're:^https?://.*\.jpg$',
- 'is_live': True,
'live_status': 'is_live',
... | yt_dlp/extractor/goodgame.py | 26 | Python | 0.429 | question | 54 | 42 | 50 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | nevack | nevack |
'channel_id': 'LampaRPG',
'channel_url': 'https://goodgame.ru/channel/LampaRPG',
'description': 'md5:ca5faa69b5d9215afdc65caeca68e1f6',
'thumbnail': r're:^https?://.*\.jpg$',
'live_status': 'is_live',
'view_count': int,
},
'params':... | Doesn't it make more sense to use `response['id']`? | 'channel': 'Pomi',
'channel_url': 'https://goodgame.ru/channel/Pomi/',
'description': 'md5:4a87b775ee7b2b57bdccebe285bbe171',
'thumbnail': r're:^https?://.*\.jpg$',
'live_status': 'is_live',
'view_count': int,
},
'params': {'skip_do... | @@ -0,0 +1,56 @@
+from .common import InfoExtractor
+from ..utils import (
+ ExtractorError,
+ clean_html,
+ int_or_none,
+ traverse_obj,
+)
+
+
+class GoodGameIE(InfoExtractor):
+ IE_NAME = 'goodgame:stream'
+ _VALID_URL = r'https?://goodgame\.ru/channel/(?P<id>\w+)'
+ _TESTS = [{
+ 'url': ... | yt_dlp/extractor/goodgame.py | 26 | Python | 0.429 | question | 51 | 38 | 40 | false | [goodgame] Add extractor | 3,686 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | nevack |
import binascii
import hashlib
import re
from ..aes import aes_cbc_decrypt_bytes, unpad_pkcs7
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
mimetype2ext,
str_or_none,
try_get,
unified_timestamp,
update_url_query,
u... | ```suggestion
(?:www\.)?dr\.dk/(?:tv/se|nyheder|(?:radio|lyd)(?:/ondemand)?)/(?:[^/]+/)*|
```
The old URL still works | import binascii
import hashlib
import re
from .common import InfoExtractor
from ..aes import aes_cbc_decrypt_bytes, unpad_pkcs7
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
int_or_none,
float_or_none,
mimetype2ext,
str_or_none,
try_get,
unified_tim... | @@ -2,28 +2,27 @@
import hashlib
import re
-
-from .common import InfoExtractor
from ..aes import aes_cbc_decrypt_bytes, unpad_pkcs7
from ..compat import compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
- int_or_none,
float_or_none,
+ int_or_none,
mimetype2ext,
str_or_n... | yt_dlp/extractor/drtv.py | 25 | Python | 0.714 | suggestion | 148 | 50 | 50 | false | [DRTV] Fix extractor to allow for new URL scheme for radio episodes | 3,708 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | vertan |
'timestamp': 1603188600,
'upload_date': '20201020',
'duration': 2576.6,
'season': 'Bonderøven 2019',
'season_id': 'urn:dr:mu:bundle:5c201667a11fa01ca4528ce5',
'release_year': 2019,
'season_number': 2019,
'series': 'Frank & K... | ```suggestion
'id': 'urn:dr:mu:programcard:6265cb2571401424d0360113',
``` | 'upload_date': '20201020',
'duration': 2576.6,
'season': 'Bonderøven 2019',
'season_id': 'urn:dr:mu:bundle:5c201667a11fa01ca4528ce5',
'release_year': 2019,
'season_number': 2019,
'series': 'Frank & Kastaniegaarden'
},
'p... | @@ -109,6 +121,24 @@ class DRTVIE(InfoExtractor):
}, {
'url': 'https://www.dr.dk/drtv/program/jagten_220924',
'only_matching': True,
+ }, {
+ 'url': 'https://www.dr.dk/lyd/p4aarhus/regionale-nyheder-ar4/regionale-nyheder-2022-05-05-12-30-3',
+ 'info_dict': {
+ 'id': "u... | yt_dlp/extractor/drtv.py | 26 | Python | 0.571 | suggestion | 87 | 51 | 51 | false | [DRTV] Fix extractor to allow for new URL scheme for radio episodes | 3,708 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | vertan |
'id': 'urn:dr:mu:programcard:57c926176187a50a9c6e83c6',
'ext': 'mp4',
'title': 'christiania pusher street ryddes drdkrjpo',
'description': 'md5:2a71898b15057e9b97334f61d04e6eb5',
'timestamp': 1472800279,
'upload_date': '20160902',
'dura... | ```suggestion
'season_id': 'urn:dr:mu:bundle:5afc03ad6187a4065ca5fd35',
``` | 'id': 'urn:dr:mu:programcard:57c926176187a50a9c6e83c6',
'ext': 'mp4',
'title': 'christiania pusher street ryddes drdkrjpo',
'description': 'md5:2a71898b15057e9b97334f61d04e6eb5',
'timestamp': 1472800279,
'upload_date': '20160902',
'dura... | @@ -71,32 +71,44 @@ class DRTVIE(InfoExtractor):
# with SignLanguage formats
'url': 'https://www.dr.dk/tv/se/historien-om-danmark/-/historien-om-danmark-stenalder',
'info_dict': {
- 'id': 'historien-om-danmark-stenalder',
+ 'id': '00831690010',
'ext': 'mp4',... | yt_dlp/extractor/drtv.py | 26 | Python | 0.571 | suggestion | 89 | 51 | 51 | false | [DRTV] Fix extractor to allow for new URL scheme for radio episodes | 3,708 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | vertan |
'description': 'md5:2a71898b15057e9b97334f61d04e6eb5',
'timestamp': 1472800279,
'upload_date': '20160902',
'duration': 131.4,
},
'params': {
'skip_download': True,
},
'expected_warnings': ['Unable to download f4m manifest'],
... | ```suggestion
'season': 'Historien om Danmark',
'series': 'Historien om Danmark',
``` | 'description': 'md5:2a71898b15057e9b97334f61d04e6eb5',
'timestamp': 1472800279,
'upload_date': '20160902',
'duration': 131.4,
},
'params': {
'skip_download': True,
},
'expected_warnings': ['Unable to download f4m manifest'],
... | @@ -71,31 +71,41 @@ class DRTVIE(InfoExtractor):
# with SignLanguage formats
'url': 'https://www.dr.dk/tv/se/historien-om-danmark/-/historien-om-danmark-stenalder',
'info_dict': {
- 'id': 'historien-om-danmark-stenalder',
+ 'id': '00831690010',
'ext': 'mp4',... | yt_dlp/extractor/drtv.py | 26 | Python | 0.714 | suggestion | 112 | 51 | 51 | false | [DRTV] Fix extractor to allow for new URL scheme for radio episodes | 3,708 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | vertan |
r'(?:www\.)?ytprivate\.com',
r'(?:www\.)?invidious\.13ad\.de',
r'(?:www\.)?invidious\.toot\.koeln',
r'(?:www\.)?invidious\.fdn\.fr',
r'(?:www\.)?watch\.nettohikari\.com',
r'(?:www\.)?invidious\.namazso\.eu',
r'(?:www\.)?invidious\.silkky\.cloud',
r'(?:www\... | ```suggestion
# piped instances from https://github.com/TeamPiped/Piped/wiki/Instances
```
Make sure to add all these | r'(?:www\.)?ytprivate\.com',
r'(?:www\.)?invidious\.13ad\.de',
r'(?:www\.)?invidious\.toot\.koeln',
r'(?:www\.)?invidious\.fdn\.fr',
r'(?:www\.)?watch\.nettohikari\.com',
r'(?:www\.)?invidious\.namazso\.eu',
r'(?:www\.)?invidious\.silkky\.cloud',
r'(?:www\... | @@ -348,6 +348,16 @@ class YoutubeBaseInfoExtractor(InfoExtractor):
r'(?:www\.)?kbjggqkzv65ivcqj6bumvp337z6264huv5kpkwuv6gu5yjiskvan7fad\.onion',
r'(?:www\.)?grwp24hodrefzvjjuccrkw3mjq4tzhaaq32amf33dzpmuxe7ilepcmad\.onion',
r'(?:www\.)?hpniueoejy4opn7bc4ftgazyqjoeqwlvh2uiku2xqku6zpoa4bf5ruid\... | yt_dlp/extractor/youtube.py | 26 | Python | 0.714 | suggestion | 130 | 51 | 51 | false | Added piped instance urls | 3,714 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | JordanWeatherby |
_TESTS = [
{
'url': 'https://nebula.app/videos/that-time-disney-remade-beauty-and-the-beast',
'md5': '14944cfee8c7beeea106320c47560efc',
'info_dict': {
'id': '5c271b40b13fd613090034fd',
'ext': 'mp4',
'title': 'That Time Disn... | ```suggestion
'thumbnail': r're:https://\w+\.cloudfront\.net/[\w-]+\.jpeg?height=720&?',
``` | _TESTS = [
{
'url': 'https://nebula.app/videos/that-time-disney-remade-beauty-and-the-beast',
'md5': '14944cfee8c7beeea106320c47560efc',
'info_dict': {
'id': '5c271b40b13fd613090034fd',
'ext': 'mp4',
'title': 'That Time Disn... | @@ -169,14 +167,25 @@ class NebulaIE(NebulaBaseIE):
'channel_id': 'lindsayellis',
'uploader': 'Lindsay Ellis',
'uploader_id': 'lindsayellis',
+
+ 'timestamp': 1533009600,
+ 'uploader_url': 'https://nebula.app/lindsayellis',
+ ... | yt_dlp/extractor/nebula.py | 26 | Python | 0.714 | suggestion | 110 | 51 | 51 | false | [nebula] Add support for subscriptions | 3,719 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hheimbuerger |
'url': tn['original'],
'height': key,
} for key, tn in episode['assets']['thumbnail'].items()],
'duration': episode['duration'],
'channel': episode['channel_title'],
'channel_id': channel_slug,
'channel_url': f'https://nebula.ap... | Any idea why the md5s have changed? | 'url': tn['original'],
'height': key,
} for key, tn in episode['assets']['thumbnail'].items()],
'duration': episode['duration'],
'channel': episode['channel_title'],
'channel_id': channel_slug,
'channel_url': f'https://nebula.ap... | @@ -157,7 +155,7 @@ class NebulaIE(NebulaBaseIE):
_TESTS = [
{
'url': 'https://nebula.app/videos/that-time-disney-remade-beauty-and-the-beast',
- 'md5': 'fe79c4df8b3aa2fea98a93d027465c7e',
+ 'md5': '14944cfee8c7beeea106320c47560efc', | yt_dlp/extractor/nebula.py | 26 | Python | 0.143 | question | 35 | 51 | 51 | false | [nebula] Add support for subscriptions | 3,719 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hheimbuerger |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.