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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
video_id = self._match_id(url)
playlist_id = self._extract_playlist_id(url, 'playlistId')
if self._yes_playlist(playlist_id, video_id):
return self._extract_playlist(playlist_id)
data = self._download_json(f'{self._API_BASE}/videos/{video_id}', video_id)
thumbnails ... | ```suggestion
'channel_url': format_field(data, 'channelId', 'https://banbye.com/channel/%s'),
``` | video_id = self._match_id(url)
playlist_id = self._extract_playlist_id(url, 'playlistId')
if self._yes_playlist(playlist_id, video_id):
return self._extract_playlist(playlist_id)
data = self._download_json(f'{self._API_BASE}/videos/{video_id}', video_id)
thumbnails ... | @@ -0,0 +1,153 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import math
+
+from .common import InfoExtractor
+from ..compat import (
+ compat_urllib_parse_urlparse,
+ compat_parse_qs,
+)
+from ..utils import (
+ format_field,
+ InAdvancePagedList,
+ traverse_obj,
+ unified_timestamp... | yt_dlp/extractor/banbye.py | 26 | Python | 0.714 | suggestion | 112 | 51 | 51 | false | [BanBye] Add extractor | 3,177 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | mezbaul-h |
# coding: utf-8
import re
from .common import InfoExtractor
from ..utils import (
qualities,
traverse_obj
)
class ITProTVIE(InfoExtractor):
_VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
_TESTS = [{
'url': 'https://app.itpro.tv/course/guided-tour/introductionitp... | use md5
```suggestion
'description': 'md5:<md5 of desc>',
``` | # coding: utf-8
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
urljoin
)
class ITProTVBaseIE(InfoExtractor):
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 23 | Python | 0.643 | suggestion | 64 | 48 | 48 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
{
'url': 'https://app.itpro.tv/course/beyond-tech/job-interview-tips',
'md5': '101a299b98c47ccf4c67f9f0951defa8',
'info_dict': {
'id': 'job-interview-tips',
'ext': 'mp4',
'title': 'Job Interview Tips',
'thumbnail': 'https://s3.amazonaws.com... | ```suggestion
headers = {'Authorization': f'Bearer {jwt}'}
```
avoid +ing strings | _VALID_URL = r'https://app.itpro.tv/course/(?P<course>[\w-]+)/(?P<id>[\w-]+)'
_TESTS = [{
'url': 'https://app.itpro.tv/course/guided-tour/introductionitprotv',
'md5': 'bca4a28c2667fd1a63052e71a94bb88c',
'info_dict': {
'id': 'introductionitprotv',
'ext': 'mp4',
... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.643 | security | 96 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'ext': 'mp4',
'title': 'Job Interview Tips',
'thumbnail': 'https://s3.amazonaws.com:443/production-itprotv-thumbnails/2f370bf5-294d-4bbe-ab80-c0b5781630ea.png',
'description': "Did you know that preparation is one of the most important aspects of a successful job intervie... | `course_api` is only set `if jwt` | 'id': 'introductionitprotv',
'ext': 'mp4',
'title': 'An Introduction to ITProTV 101',
'thumbnail': 'https://itprotv-image-bucket.s3.amazonaws.com/getting-started/itprotv-101-introduction-PGM.11_39_56_02.Still001.png',
'description': 'md5:b175c2c3061ce35a4dd338... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.214 | suggestion | 33 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
]
def _get_course_api_json(self, webpage, course_name):
jwt = self._fetch_jwt(webpage)
if jwt:
headers = {'Authorization': 'Bearer ' + jwt}
course_api = self._download_json(
f'https://api.itpro.tv/api/urza/v3/consumer-web/course?url={course_name}&brand=0... | ```suggestion
return self._search_regex(r'{"passedToken":"([\w-]*\.[\w-]*\.[\w-]+)",', webpage, 'jwt')
```
also, are u sure the `*`s are not meant to be `+`? | {
'url': 'https://app.itpro.tv/course/beyond-tech/job-interview-tips',
'md5': '101a299b98c47ccf4c67f9f0951defa8',
'info_dict': {
'id': 'job-interview-tips',
'ext': 'mp4',
'title': 'Job Interview Tips',
'thumbnail': 'https://s3.amazonaws.com... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.714 | question | 168 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
jwt = self._fetch_jwt(webpage)
if jwt:
headers = {'Authorization': 'Bearer ' + jwt}
course_api = self._download_json(
f'https://api.itpro.tv/api/urza/v3/consumer-web/course?url={course_name}&brand=00002560-0000-3fa9-0000-1d61000035f3',
course_name... | ```suggestion
if re.match(r'{\s*member\s*:\s*null', webpage):
```
would be better, no? | 'info_dict': {
'id': 'job-interview-tips',
'ext': 'mp4',
'title': 'Job Interview Tips',
'thumbnail': 'https://s3.amazonaws.com:443/production-itprotv-thumbnails/2f370bf5-294d-4bbe-ab80-c0b5781630ea.png',
'description': 'md5:30d8ba483febdf89ec85623aad3c... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.786 | question | 97 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
if jwt:
headers = {'Authorization': 'Bearer ' + jwt}
course_api = self._download_json(
f'https://api.itpro.tv/api/urza/v3/consumer-web/course?url={course_name}&brand=00002560-0000-3fa9-0000-1d61000035f3',
course_name, headers=headers, note='Fetching data ... | ```suggestion
raise self.raise_login_required()
```
due to some recent changes, method is now automatically determined | 'id': 'job-interview-tips',
'ext': 'mp4',
'title': 'Job Interview Tips',
'thumbnail': 'https://s3.amazonaws.com:443/production-itprotv-thumbnails/2f370bf5-294d-4bbe-ab80-c0b5781630ea.png',
'description': 'md5:30d8ba483febdf89ec85623aad3c3cb6',
'dur... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.786 | suggestion | 133 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
def _get_episode_api_json(self, webpage, episode_id):
jwt = self._fetch_jwt(webpage)
if jwt:
headers = {'Authorization': 'Bearer ' + jwt}
episode_api = self._download_json(
f'https://api.itpro.tv/api/urza/v3/consumer-web/brand/00002560-0000-3fa9-0000-1d610000... | `self._search_regex`
Also, `+` and `*` aren't interchangable | 'chapter': 'Job Development',
'chapter_number': 2,
'chapter_id': '5f7c78d424330c000edf04d9'
},
}]
def _real_extract(self, url):
episode_id, course_name = self._match_valid_url(url).group('id', 'course')
webpage = self._download_webpage(url, episode_id... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.357 | suggestion | 63 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
if jwt:
headers = {'Authorization': 'Bearer ' + jwt}
episode_api = self._download_json(
f'https://api.itpro.tv/api/urza/v3/consumer-web/brand/00002560-0000-3fa9-0000-1d61000035f3/episode?url={episode_id}',
episode_id, headers=headers, note='Fetching data ... | ```suggestion
course = self._get_course_api_json(webpage, course_name)['course']
``` | 'chapter_id': '5f7c78d424330c000edf04d9'
},
}]
def _real_extract(self, url):
episode_id, course_name = self._match_valid_url(url).group('id', 'course')
webpage = self._download_webpage(url, episode_id)
self._check_if_logged_in(webpage)
course = self._call_api... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.571 | suggestion | 94 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
webpage = self._download_webpage(url, episode_id)
self._check_if_logged_in(webpage)
course_name = re.match(r'https?://.*/course/(?P<course_name>[0-9a-z-]+)/.*', url).group(1)
course_api = self._get_course_api_json(webpage, course_name)
course = course_api['course']
epis... | Setting `quality` statically is redundant | 'formats': [
{'url': episode[f'jwVideo{h}Embed'], 'height': h}
for h in (320, 480, 720, 1080) if episode.get(f'jwVideo{h}Embed')
],
'duration': int_or_none(episode.get('length')),
'series': course.get('name'),
'series_id': cours... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.214 | suggestion | 42 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
course_name = re.match(r'https?://.*/course/(?P<course_name>[0-9a-z-]+)/.*', url).group(1)
course_api = self._get_course_api_json(webpage, course_name)
course = course_api['course']
episode_api = self._get_episode_api_json(webpage, episode_id)
episode = episode_api['episode']
... | ```suggestion
'duration': int_or_none(episode.get('length')),
```
etc | for h in (320, 480, 720, 1080) if episode.get(f'jwVideo{h}Embed')
],
'duration': int_or_none(episode.get('length')),
'series': course.get('name'),
'series_id': course.get('url'),
'chapter': str_or_none(chapter.get('title')),
'chapte... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.571 | suggestion | 84 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
episode_api = self._get_episode_api_json(webpage, episode_id)
episode = episode_api['episode']
for i in range(len(course.get('topics'))):
if traverse_obj(course, ('topics', i, 'id'), expected_type=str) == episode.get('topic'):
chapter_name = traverse_obj(course, ('t... | You said "most" videos need auth. Do all videos? Otherwise, this is wrong | 'series_id': course.get('url'),
'chapter': str_or_none(chapter.get('title')),
'chapter_number': chapter_number,
'chapter_id': str_or_none(chapter.get('id')),
'subtitles': {
'en': [{'ext': 'vtt', 'data': episode['enCaptionData']}]
} ... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.214 | bug | 73 | 51 | 47 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
self._check_if_logged_in(webpage)
course_name = re.match(r'https?://.*/course/(?P<course_name>[0-9a-z-]+)/.*', url).group(1)
course_api = self._get_course_api_json(webpage, course_name)
course = course_api['course']
episode_api = self._get_episode_api_json(webpage, episode_id)
... | DRY
```suggestion
'formats': [
{'url': episode[f'jwVideo{h}Embed'], 'height': h}
for h in (320, 480, 720, 1080) if episode.get(f'jwVideo{h}Embed')
],
``` | {'url': episode[f'jwVideo{h}Embed'], 'height': h}
for h in (320, 480, 720, 1080) if episode.get(f'jwVideo{h}Embed')
],
'duration': int_or_none(episode.get('length')),
'series': course.get('name'),
'series_id': course.get('url'),
... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.786 | refactor | 215 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
if '{ member: null' in webpage:
raise self.raise_login_required(method='cookies')
def _real_extract(self, url):
QUALITIES = qualities(['low', 'medium', 'high', 'veryhigh'])
episode_id = self._match_id(url)
webpage = self._download_webpage(url, episode_id)
self._... | ```suggestion
'title': episode.get('title'),
``` | if traverse_obj(topic, 'id') == episode.get('topic')), {})
return {
'id': episode_id,
'title': episode.get('title'),
'description': episode.get('description'),
'thumbnail': episode.get('thumbnail'),
'formats': [
{'url': epi... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.571 | suggestion | 62 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
def _fetch_jwt(self, webpage):
return self._search_regex(r'{"passedToken":"([A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]+)",', webpage, 'jwt')
def _check_if_logged_in(self, webpage):
if '{ member: null' in webpage:
raise self.raise_login_required(method='cookies')
def _real_ex... | ```suggestion
chapter_number, chapter = next((
(i, topic) for i, topic in enumerate(course.get('topics') or [], 1)
if traverse_obj(topic, 'id') == episode.get('topic')), {})
```
then u can return
```py
'chapter': str_or_none(chapter.get('title')),
...
``` | episode = self._call_api('episode', episode_id, webpage)
chapter_number, chapter = next((
(i, topic) for i, topic in enumerate(course.get('topics') or [], 1)
if traverse_obj(topic, 'id') == episode.get('topic')), {})
return {
'id': episode_id,
't... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.786 | suggestion | 297 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
if traverse_obj(course, ('topics', i, 'id'), expected_type=str) == episode.get('topic'):
chapter_name = traverse_obj(course, ('topics', i, 'title'), expected_type=str)
chapter_id = traverse_obj(course, ('topics', i, 'id'), expected_type=str)
chapter_number = i... | ```suggestion
'subtitles': {
'en': [{'ext': 'vtt', 'data': episode['enCaptionData']}]
} if episode.get('enCaptionData') else None,
``` | 'en': [{'ext': 'vtt', 'data': episode['enCaptionData']}]
} if episode.get('enCaptionData') else None,
}
class ITProTVCourseIE(ITProTVBaseIE):
_VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[\w-]+)/?(?:$|[#?])'
_TESTS = [
{
'url': 'https://app.itpro.t... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.714 | suggestion | 178 | 51 | 42 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'id': 'guided-tour',
'ext': 'mp4',
},
'params': {
'skip_download': True,
},
},
{
'url': 'https://app.itpro.tv/course/beyond-tech',
'info_dict': {
'id': 'beyond-tech',
... | ```suggestion
course_api = self._get_course_api_json(webpage, course_id)['course']
``` | # coding: utf-8
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
urljoin
)
class ITProTVBaseIE(InfoExtractor):
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.571 | suggestion | 96 | 40 | 142 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'id': 'beyond-tech',
'ext': 'mp4',
},
'params': {
'skip_download': True,
},
},
]
def _real_extract(self, url):
course_id = self._match_id(url)
webpage = self._download_webpage(url, course_id)
sel... | ```py
entries = [self.url_result(...) for for episode in course['episodes']]
``` | # coding: utf-8
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
urljoin
)
class ITProTVBaseIE(InfoExtractor):
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.571 | suggestion | 90 | 30 | 142 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
return {
'id': episode_id,
'title': episode['title'],
'description': episode.get('description'),
'thumbnail': episode.get('thumbnail'),
'formats': [
{'url': episode.get('jwVideo320Embed'), 'height': 320, 'quality': QUALITIES('low')},
... | Dont inherit from a proper IE. create a base class from which both can inherit |
class ITProTVCourseIE(ITProTVBaseIE):
_VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[\w-]+)/?(?:$|[#?])'
_TESTS = [
{
'url': 'https://app.itpro.tv/course/guided-tour',
'info_dict': {
'id': 'guided-tour',
'description': 'md5:b175c2c3061ce35a4d... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.214 | suggestion | 78 | 51 | 38 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
return {
'id': episode_id,
'title': episode['title'],
'description': episode.get('description'),
'thumbnail': episode.get('thumbnail'),
'formats': [
{'url': episode.get('jwVideo320Embed'), 'height': 320, 'quality': QUALITIES('low')},
... | ```suggestion
_VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[0-9a-z-]+)'
``` | class ITProTVCourseIE(ITProTVBaseIE):
_VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[\w-]+)/?(?:$|[#?])'
_TESTS = [
{
'url': 'https://app.itpro.tv/course/guided-tour',
'info_dict': {
'id': 'guided-tour',
'description': 'md5:b175c2c3061ce35a4dd... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.571 | suggestion | 87 | 51 | 37 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
course = course_api['course']
episode_api = self._get_episode_api_json(webpage, episode_id)
episode = episode_api['episode']
for i in range(len(course.get('topics'))):
if traverse_obj(course, ('topics', i, 'id'), expected_type=str) == episode.get('topic'):
c... | playlist tests MUST define atleast one of `playlist`, `playlist_count`, `playlist_mincount` or `playlist_maxcount`. This is why these tests are failing | 'series': course.get('name'),
'series_id': course.get('url'),
'chapter': str_or_none(chapter.get('title')),
'chapter_number': chapter_number,
'chapter_id': str_or_none(chapter.get('id')),
'subtitles': {
'en': [{'ext': 'vtt', 'data':... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.5 | bug | 151 | 51 | 48 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
episode_api = self._download_json(
f'https://api.itpro.tv/api/urza/v3/consumer-web/brand/00002560-0000-3fa9-0000-1d61000035f3/episode?url={episode_id}',
episode_id, headers=headers, note='Fetching data from episode API')
return episode_api
def _fetch_jwt(self, w... | ```suggestion
episode_api = self._get_episode_api_json(webpage, episode_id)['episode']
``` |
def _real_extract(self, url):
episode_id, course_name = self._match_valid_url(url).group('id', 'course')
webpage = self._download_webpage(url, episode_id)
self._check_if_logged_in(webpage)
course = self._call_api('course', course_name, webpage)
episode = self._call_api('epis... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.714 | suggestion | 100 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'params': {
'skip_download': True,
},
},
]
def _real_extract(self, url):
course_id = self._match_id(url)
webpage = self._download_webpage(url, course_id)
self._check_if_logged_in(webpage)
course_api = self._get_course_api_json(webp... | ```suggestion
return self.playlist_result(
entries, course_id, course.get('name'), course.get('description'))
``` | # coding: utf-8
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
urljoin
)
class ITProTVBaseIE(InfoExtractor):
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560... | @@ -0,0 +1,174 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'https://app.itpro.tv/... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.714 | suggestion | 136 | 27 | 142 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
return {
'id': episode_id,
'title': episode.get('title'),
'description': episode.get('description'),
'thumbnail': episode.get('thumbnail'),
'formats': [
{'url': episode[f'jwVideo{h}Embed'], 'height': h}
for h in (320, 48... | ```suggestion
_VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[0-9a-z-]+)/?(?:$|[#?])'
```
should fix the `test_all_urls` issue | }
class ITProTVCourseIE(ITProTVBaseIE):
_VALID_URL = r'https?://app.itpro.tv/course/(?P<id>[\w-]+)/?(?:$|[#?])'
_TESTS = [
{
'url': 'https://app.itpro.tv/course/guided-tour',
'info_dict': {
'id': 'guided-tour',
'description': 'md5:b175c2c... | @@ -0,0 +1,173 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ int_or_none,
+ qualities,
+ traverse_obj
+)
+
+
+class ITProTVIE(InfoExtractor):
+ _VALID_URL = r'https://app.itpro.tv/course/([0-9a-z-]+)/(?P<id>[0-9a-z-]+)'
+ _TESTS = [{
+ 'url': 'htt... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.786 | suggestion | 137 | 51 | 40 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'info_dict': {
'id': 'guided-tour',
'description': 'md5:b175c2c3061ce35a4dd33865b2c1da4e',
'title': 'ITProTV 101',
},
'playlist_count': 6
},
{
'url': 'https://app.itpro.tv/course/beyond-tech',
'in... | ```suggestion
urljoin(url, f'{course_id}/{episode["url"]}'), ITProTVIE,
episode['url'], episode.get('title'), url_transparent=True)
``` | # coding: utf-8
import re
from .common import InfoExtractor
from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
urljoin
)
class ITProTVBaseIE(InfoExtractor):
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560... | @@ -0,0 +1,156 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class ITProTVBaseIE(InfoExtractor):
+ def _get_course_api_json(self, webpage, course_name):
+ jwt = self._fetch_jwt(webpage)
+
+ if jwt... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.714 | suggestion | 162 | 31 | 142 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
urljoin
)
class ITProTVBaseIE(InfoExtractor):
def _get_course_api_json(self, webpage, course_name):
jwt = self._fetch_jwt(webpage)
if jwt:
headers = {'Authorization': f'Bearer {jwt}'}
course_api = self._download_json(
f'https://api.itpro.tv/api/urza/v3/... | ```suggestion
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560-0000-3fa9-0000-1d61000035f3/episode?url={}'
}
def _call_api(self, ep, item_id, webpage):
return self._download_json(
f'https://api.it... | traverse_obj,
urljoin
)
class ITProTVBaseIE(InfoExtractor):
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560-0000-3fa9-0000-1d61000035f3/episode?url={}'
}
def _call_api(self, ep, item_id, webpage):
return self.... | @@ -0,0 +1,156 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class ITProTVBaseIE(InfoExtractor):
+ def _get_course_api_json(self, webpage, course_name):
+ jwt = self._fetch_jwt(webpage)
+
+ if jwt... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.786 | security | 867 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
},
{
'url': 'https://app.itpro.tv/course/beyond-tech/job-interview-tips',
'md5': '101a299b98c47ccf4c67f9f0951defa8',
'info_dict': {
'id': 'job-interview-tips',
'ext': 'mp4',
'title': 'Job Interview Tips',
'thumbnail': 'https://s3.amazon... | ```suggestion
episode_id, course_name = self._match_valid_url(url).group('id', 'course')
webpage = self._download_webpage(url, episode_id)
self._check_if_logged_in(webpage)
```
(see next comment) | 'duration': 267,
'series': 'Beyond Tech',
'series_id': 'beyond-tech',
'availability': 'needs_auth',
'chapter': 'Job Development',
'chapter_number': 2,
'chapter_id': '5f7c78d424330c000edf04d9'
},
}]
def _real_extract(sel... | @@ -0,0 +1,156 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class ITProTVBaseIE(InfoExtractor):
+ def _get_course_api_json(self, webpage, course_name):
+ jwt = self._fetch_jwt(webpage)
+
+ if jwt... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.786 | suggestion | 224 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
f'https://api.itpro.tv/api/urza/v3/consumer-web/course?url={course_name}&brand=00002560-0000-3fa9-0000-1d61000035f3',
course_name, headers=headers, note='Fetching data from course API')
return course_api
def _get_episode_api_json(self, webpage, episode_id):
jwt ... | ```suggestion
_VALID_URL = r'https://app.itpro.tv/course/(?P<course>[\w-]+)/(?P<id>[\w-]+)'
``` | def _call_api(self, ep, item_id, webpage):
return self._download_json(
f'https://api.itpro.tv/api/urza/v3/consumer-web/{self._ENDPOINTS[ep].format(item_id)}',
item_id, note=f'Fetching {ep} data API',
headers={'Authorization': f'Bearer {self._fetch_jwt(webpage)}'})[ep]
... | @@ -0,0 +1,156 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ int_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class ITProTVBaseIE(InfoExtractor):
+ def _get_course_api_json(self, webpage, course_name):
+ jwt = self._fetch_jwt(webpage)
+
+ if jwt... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.714 | suggestion | 101 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
urljoin
)
class ITProTVBaseIE(InfoExtractor):
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560-0000-3fa9-0000-1d61000035f3/episode?url={}'
}
def _ca... | ```suggestion
self.raise_login_required()
``` | from ..utils import (
int_or_none,
str_or_none,
traverse_obj,
urljoin
)
class ITProTVBaseIE(InfoExtractor):
_ENDPOINTS = {
'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',
'episode': 'brand/00002560-0000-3fa9-0000-1d61000035f3/episode?url={}'
}
def _ca... | @@ -0,0 +1,141 @@
+# coding: utf-8
+
+import re
+
+from .common import InfoExtractor
+
+from ..utils import (
+ int_or_none,
+ str_or_none,
+ traverse_obj,
+ urljoin
+)
+
+
+class ITProTVBaseIE(InfoExtractor):
+ _ENDPOINTS = {
+ 'course': 'course?url={}&brand=00002560-0000-3fa9-0000-1d61000035f3',... | yt_dlp/extractor/itprotv.py | 26 | Python | 0.571 | suggestion | 59 | 51 | 51 | false | ITProTV | 3,196 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
self.raise_geo_restricted()
else:
if json.get('message') and str(json['code']) != json['message']:
errmsg = f'{kwargs.get("errnote", "Unable to download JSON metadata")}: {self.IE_NAME} said: {json["message"]}'
else:
err... | this code is repeated in get_formats. It can be separated into a function (or better, incoperated into call_api?) | elif json['code'] == 10004001:
self.raise_geo_restricted()
else:
if json.get('message') and str(json['code']) != json['message']:
errmsg = f'{kwargs.get("errnote", "Unable to download JSON metadata")}: {self.IE_NAME} said: {json["message"]}'
... | @@ -755,15 +755,24 @@ def json2srt(self, json):
for i, line in enumerate(json['body']) if line.get('content'))
return data
- def _get_subtitles(self, ep_id):
- sub_json = self._call_api(f'/web/v2/subtitle?episode_id={ep_id}&platform=web', ep_id)
+ def _get_subtitles(self, *, ep_id=N... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.429 | style | 113 | 51 | 51 | false | [BiliIntl] Support user-generated content videos | 3,203 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wlritchi |
'width': video_res.get('width'),
'height': video_res.get('height'),
'vbr': video_res.get('bandwidth'),
'acodec': 'none',
'vcodec': video_res.get('codecs'),
'filesize': video_res.get('size'),
})
for aud in... | ```suggestion
'title': video_data.get('title_display') or video_data.get('title'),
``` | 'filesize': video_res.get('size'),
})
for aud in video_json.get('audio_resource') or []:
if not aud.get('url'):
continue
formats.append({
'url': aud['url'],
'ext': 'mp4',
'abr': aud.get('bandwidth... | @@ -809,15 +826,15 @@ def _get_formats(self, ep_id):
self._sort_formats(formats)
return formats
- def _extract_ep_info(self, episode_data, ep_id):
+ def _extract_video_info(self, video_data, *, ep_id=None, aid=None):
return {
- 'id': ep_id,
- 'title': episode_dat... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 100 | 51 | 51 | false | [BiliIntl] Support user-generated content videos | 3,203 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wlritchi |
'acodec': 'none',
'vcodec': video_res.get('codecs'),
'filesize': video_res.get('size'),
})
for aud in video_json.get('audio_resource') or []:
if not aud.get('url'):
continue
formats.append({
'url'... | ```suggestion
r'^E(\d+)(?:$| - )', video_data.get('title_display') or ''), 'episode number', default=None)),
``` | if not aud.get('url'):
continue
formats.append({
'url': aud['url'],
'ext': 'mp4',
'abr': aud.get('bandwidth'),
'acodec': aud.get('codecs'),
'vcodec': 'none',
'filesize': aud.get('size'... | @@ -809,15 +826,15 @@ def _get_formats(self, ep_id):
self._sort_formats(formats)
return formats
- def _extract_ep_info(self, episode_data, ep_id):
+ def _extract_video_info(self, video_data, *, ep_id=None, aid=None):
return {
- 'id': ep_id,
- 'title': episode_dat... | yt_dlp/extractor/bilibili.py | 26 | Python | 0.714 | suggestion | 130 | 51 | 51 | false | [BiliIntl] Support user-generated content videos | 3,203 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | wlritchi |
'description': 'md5:8270d0ef5427d3c895a27351aeaac276',
},
'playlist_mincount': 1,
}]
def _real_extract(self, url):
video_name = self._match_id(url)
webpage = self._download_webpage(url, video_name)
extra_data = get_element_by_id('vidstore-classes_class-video... | you don't need an `else` block since all classes should have `lessons`. `preview` is optional though | 'title': 'Sew Your Own Designer Handbag',
'description': 'md5:8270d0ef5427d3c895a27351aeaac276',
},
'playlist_mincount': 1,
}, {
'url': 'https://www.craftsy.com/class/all-access-estes-park-wool-market/',
'info_dict': {
'id': 'all-access-estes-park-... | @@ -0,0 +1,63 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+)
+
+
+class CraftsyIE(InfoExtractor):
+ _VALID_URL = r'https?://www.craftsy.com/class/(?P<id>[a-z0-9_-]+)... | yt_dlp/extractor/craftsy.py | 26 | Python | 0.571 | suggestion | 100 | 36 | 44 | false | [Craftsy] Add support for craftsy site. | 3,208 | yt-dlp/yt-dlp | 132,642 | Python | mezbaul-h | Bricio |
},
'playlist_count': 10,
}, {
'url': 'https://www.craftsy.com/class/sew-your-own-designer-handbag/',
'info_dict': {
'id': 'sew-your-own-designer-handbag',
'title': 'Sew Your Own Designer Handbag',
'description': 'md5:8270d0ef5427d3c895a27351aeaac27... | Use `self._parse_json` with a `transform_source` | 'description': 'md5:113eda818e985d1a566625fb2f833b7a',
},
'playlist_count': 10,
}, {
'url': 'https://www.craftsy.com/class/sew-your-own-designer-handbag/',
'info_dict': {
'id': 'sew-your-own-designer-handbag',
'title': 'Sew Your Own Designer Handba... | @@ -0,0 +1,73 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+)
+
+
+class CraftsyIE(InfoExtractor):
+ _VALID_URL = r'https?://www.craftsy.com/class/(?P<id>[a-z0-9_-]+)... | yt_dlp/extractor/craftsy.py | 26 | Python | 0.286 | suggestion | 48 | 51 | 51 | false | [Craftsy] Add support for craftsy site. | 3,208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Bricio |
'info_dict': {
'id': 'the-midnight-quilt-show-season-5',
'title': 'The Midnight Quilt Show Season 5',
'description': 'md5:113eda818e985d1a566625fb2f833b7a',
},
'playlist_count': 10,
}, {
'url': 'https://www.craftsy.com/class/sew-your-own-designer-h... | ```suggestion
video_id = self._match_id(url)
``` | 'url': 'https://www.craftsy.com/class/the-midnight-quilt-show-season-5/',
'info_dict': {
'id': 'the-midnight-quilt-show-season-5',
'title': 'The Midnight Quilt Show Season 5',
'description': 'md5:113eda818e985d1a566625fb2f833b7a',
},
'playlist_count': ... | @@ -0,0 +1,73 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+)
+
+
+class CraftsyIE(InfoExtractor):
+ _VALID_URL = r'https?://www.craftsy.com/class/(?P<id>[a-z0-9_-]+)... | yt_dlp/extractor/craftsy.py | 26 | Python | 0.571 | suggestion | 58 | 51 | 51 | false | [Craftsy] Add support for craftsy site. | 3,208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Bricio |
}]
def _real_extract(self, url):
video_name = self._match_id(url)
webpage = self._download_webpage(url, video_name)
extra_data = get_element_by_id('vidstore-classes_class-video-player-js-extra', webpage)
video_data = json.loads(js_to_json(self._search_regex(
r'class... | ```suggestion
if dict_get(video_data, ('is_free', 'user_has_access')):
``` | 'playlist_count': 6,
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
video_data = self._parse_json(self._search_regex(
r'class_video_player_vars\s*=\s*({.*})\s*;',
get_element_by_id('vidstor... | @@ -0,0 +1,73 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+)
+
+
+class CraftsyIE(InfoExtractor):
+ _VALID_URL = r'https?://www.craftsy.com/class/(?P<id>[a-z0-9_-]+)... | yt_dlp/extractor/craftsy.py | 26 | Python | 0.643 | suggestion | 84 | 35 | 33 | false | [Craftsy] Add support for craftsy site. | 3,208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Bricio |
extra_data = get_element_by_id('vidstore-classes_class-video-player-js-extra', webpage)
video_data = json.loads(js_to_json(self._search_regex(
r'class_video_player_vars\s*=\s*({.*})\s*;',
extra_data, 'video data')))
account_id = traverse_obj(video_data, ('video_player', ... | ```suggestion
entries += [
self.url_result(
f'http://players.brightcove.net/{account_id}/default_default/index.html?videoId={lesson["video_id"]}',
BrightcoveNewIE, lesson['video_id'], lesson.get('title'))
for lesson in video_data['... |
video_data = self._parse_json(self._search_regex(
r'class_video_player_vars\s*=\s*({.*})\s*;',
get_element_by_id('vidstore-classes_class-video-player-js-extra', webpage),
'video data'), video_id, transform_source=js_to_json)
account_id = traverse_obj(video_data, ('v... | @@ -0,0 +1,73 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+)
+
+
+class CraftsyIE(InfoExtractor):
+ _VALID_URL = r'https?://www.craftsy.com/class/(?P<id>[a-z0-9_-]+)... | yt_dlp/extractor/craftsy.py | 26 | Python | 0.786 | suggestion | 350 | 29 | 27 | false | [Craftsy] Add support for craftsy site. | 3,208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Bricio |
}, {
'url': 'https://www.craftsy.com/class/all-access-estes-park-wool-market/',
'info_dict': {
'id': 'all-access-estes-park-wool-market',
'title': 'All Access: Estes Park Wool Market',
'description': 'md5:aded1bd8d38ae2fae4dae936c0ae01e7',
},
'play... | none of these need to be variables (since they are only used once). Just use them directly where needed | 'playlist_mincount': 1,
}, {
'url': 'https://www.craftsy.com/class/all-access-estes-park-wool-market/',
'info_dict': {
'id': 'all-access-estes-park-wool-market',
'title': 'All Access: Estes Park Wool Market',
'description': 'md5:aded1bd8d38ae2fae4dae936c0a... | @@ -0,0 +1,73 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+import json
+
+from .common import InfoExtractor
+from ..utils import (
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+)
+
+
+class CraftsyIE(InfoExtractor):
+ _VALID_URL = r'https?://www.craftsy.com/class/(?P<id>[a-z0-9_-]+)... | yt_dlp/extractor/craftsy.py | 26 | Python | 0.429 | suggestion | 103 | 43 | 41 | false | [Craftsy] Add support for craftsy site. | 3,208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Bricio |
get_element_by_id('vidstore-classes_class-video-player-js-extra', webpage),
'video data'), video_id, transform_source=js_to_json)
account_id = traverse_obj(video_data, ('video_player', 'bc_account_id'))
entries = []
class_preview = traverse_obj(video_data, ('video_playe... | ```suggestion
return self.playlist_result(
entries, video_id, video_data.get('class_title'),
self._html_search_meta(('og:description', 'description'), webpage, default=None))
``` | # coding: utf-8
from __future__ import unicode_literals
from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
from ..utils import (
dict_get,
get_element_by_id,
js_to_json,
traverse_obj,
)
class CraftsyIE(InfoExtractor):
_VALID_URL = r'https?://www.craftsy.com/class/(?P<id>[a... | @@ -0,0 +1,74 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .brightcove import BrightcoveNewIE
+from .common import InfoExtractor
+
+from ..utils import (
+ dict_get,
+ get_element_by_id,
+ js_to_json,
+ traverse_obj,
+)
+
+
+class CraftsyIE(InfoExtractor):
+ _VALID_URL = r'https?:... | yt_dlp/extractor/craftsy.py | 26 | Python | 0.786 | suggestion | 214 | 27 | 72 | false | [Craftsy] Add support for craftsy site. | 3,208 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Bricio |
# coding: utf-8
from __future__ import unicode_literals
import hashlib
import time
import urllib.parse
from .common import InfoExtractor
from ..utils import (
join_nonempty,
)
class FptplayIE(InfoExtractor):
_VALID_URL = r'https?://fptplay\.vn/(?P<type>xem-video)/[^/]+\-(?P<id>\w+)(?:/tap-(?P<episode>[^/]+)... | shouldn't this be `(?P<episode>\d+)`?
below code is expecting it to be an int | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import time
import urllib.parse
from .common import InfoExtractor
from ..utils import (
clean_html,
join_nonempty,
strip_or_none,
)
class FptplayIE(InfoExtractor):
_VALID_URL = r'https?://fptplay\.vn/xem-video/[^/]+\-(?P<id>\w+)(... | @@ -7,12 +7,14 @@
from .common import InfoExtractor
from ..utils import (
+ clean_html,
join_nonempty,
+ strip_or_none,
)
class FptplayIE(InfoExtractor):
- _VALID_URL = r'https?://fptplay\.vn/(?P<type>xem-video)/[^/]+\-(?P<id>\w+)(?:/tap-(?P<episode>[^/]+)?/?(?:[?#]|$)|)'
+ _VALID_URL = r'htt... | yt_dlp/extractor/fptplay.py | 17 | Python | 0.429 | suggestion | 78 | 42 | 42 | false | [fptplay] Improve extractor | 3,218 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
raise
self._set_dailymotion_cookie('access_token' if username else 'client_token', token)
self._HEADERS['Authorization'] = 'Bearer ' + token
resp = self._download_json(
'https://graphql.api.dailymotion.com/', xid, note, data=json.dumps({
... | ```suggestion
[/=](?P<id>[^/?_&]+)(?:.+?\bplaylist=(?P<playlist_id>x[0-9a-z]+))?
``` | raise
self._set_dailymotion_cookie('access_token' if username else 'client_token', token)
self._HEADERS['Authorization'] = 'Bearer ' + token
resp = self._download_json(
'https://graphql.api.dailymotion.com/', xid, note, data=json.dumps({
... | @@ -94,10 +94,10 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
_VALID_URL = r'''(?ix)
https?://
(?:
- (?:(?:www|touch)\.)?dailymotion\.[a-z]{2,3}/(?:(?:(?:embed|swf|\#)/)?video|swf)|
+ (?:(?:www|touch|geo)\.... | yt_dlp/extractor/dailymotion.py | 26 | Python | 0.714 | suggestion | 110 | 51 | 51 | false | [dailymotion] Improve extractor | 3,230 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
'description': 'Office Christmas Party Review - Jason Bateman, Olivia Munn, T.J. Miller',
'duration': 187,
'timestamp': 1493651285,
'upload_date': '20170501',
'uploader': 'Deadline',
'uploader_id': 'x1xm8ri',
'age_limit': 0,
},... | This should be made less specific, eg (supposing `Tncwi1YGKdvFbDuDY` is an immutable thumbnail ID for this video):
```
'thumbnail': r're:https?://\w+\.dmcdn\.net/v/Tncwi1YGKdvFbDuDY/x1080',
``` | 'description': 'Office Christmas Party Review - Jason Bateman, Olivia Munn, T.J. Miller',
'duration': 187,
'timestamp': 1493651285,
'upload_date': '20170501',
'uploader': 'Deadline',
'uploader_id': 'x1xm8ri',
'age_limit': 0,
},... | @@ -115,6 +115,25 @@ class DailymotionIE(DailymotionBaseInfoExtractor):
'uploader_id': 'x1xm8ri',
'age_limit': 0,
},
+ }, {
+ 'url': 'https://geo.dailymotion.com/player.html?video=x89eyek&mute=true',
+ 'md5': 'e2f9717c6604773f963f069ca53a07f8',
+ 'info_dict': {... | yt_dlp/extractor/dailymotion.py | 26 | Python | 0.857 | suggestion | 208 | 51 | 51 | false | [dailymotion] Improve extractor | 3,230 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | hatienl0i2612 |
_TOKEN = None
def _perform_login(self, username, password):
response = self._download_json(
f'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key={self._API_KEY}', None, note='Logging in',
data=urlencode_postdata({'email': username, 'password': password, 'r... | ```suggestion
if launch_api.get('url'):
return self._search_regex(r'https?://player\.vimeo\.com/video/(?P<vimeo_id>[0-9]+)', launch_api['url'], 'vimeo_id')
return traverse_obj(launch_api, ('vendor_data', 'content', ..., 'videoId'), get_all=False)
``` | _TOKEN = None
def _perform_login(self, username, password):
CybraryBaseIE._TOKEN = self._download_json(
f'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key={self._API_KEY}',
None, data=urlencode_postdata({'email': username, 'password': password, 'returnSe... | @@ -0,0 +1,147 @@
+# coding: utf-8
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata
+)
+
+
+class CybraryBaseIE(InfoExtractor):
+ _API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
+ _ENDPOINTS = {
+ ... | yt_dlp/extractor/cybrary.py | 26 | Python | 0.786 | suggestion | 282 | 51 | 51 | false | [Cybrary] Add extractor | 3,264 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'expected_warnings': ['No authenticators for vimeo']
}, {
'url': 'https://app.cybrary.it/immersive/12747143/activity/52686',
'md5': '62f26547dccc59c44363e2a13d4ad08d',
'info_dict': {
'id': '445638073',
'ext': 'mp4',
'title': 'Azure Virtual Network ... | ```suggestion
activity = traverse_obj(course, ('learning_modules', ..., 'activities', lambda _, v: int(activity_id) == v['id']), get_all=False)
``` | 'url': 'https://app.cybrary.it/immersive/12747143/activity/52686',
'md5': '62f26547dccc59c44363e2a13d4ad08d',
'info_dict': {
'id': '445638073',
'ext': 'mp4',
'title': 'Azure Virtual Network IP Addressing',
'thumbnail': 'https://i.vimeocdn.com/video... | @@ -0,0 +1,147 @@
+# coding: utf-8
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata
+)
+
+
+class CybraryBaseIE(InfoExtractor):
+ _API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
+ _ENDPOINTS = {
+ ... | yt_dlp/extractor/cybrary.py | 26 | Python | 0.714 | suggestion | 157 | 51 | 51 | false | [Cybrary] Add extractor | 3,264 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'md5': '62f26547dccc59c44363e2a13d4ad08d',
'info_dict': {
'id': '445638073',
'ext': 'mp4',
'title': 'Azure Virtual Network IP Addressing',
'thumbnail': 'https://i.vimeocdn.com/video/936667051-1647ace66c627d4a2382185e0dae8deb830309bfddd53f8b2367b2f91e92ed0e... | ```suggestion
raise ExtractorError('The activity is not a video', expected=True)
``` | 'id': '445638073',
'ext': 'mp4',
'title': 'Azure Virtual Network IP Addressing',
'thumbnail': 'https://i.vimeocdn.com/video/936667051-1647ace66c627d4a2382185e0dae8deb830309bfddd53f8b2367b2f91e92ed0e-d_1280',
'series_id': '52733',
'uploader_url': 'h... | @@ -0,0 +1,147 @@
+# coding: utf-8
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata
+)
+
+
+class CybraryBaseIE(InfoExtractor):
+ _API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
+ _ENDPOINTS = {
+ ... | yt_dlp/extractor/cybrary.py | 26 | Python | 0.786 | refactor | 98 | 51 | 51 | false | [Cybrary] Add extractor | 3,264 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'id': '445638073',
'ext': 'mp4',
'title': 'Azure Virtual Network IP Addressing',
'thumbnail': 'https://i.vimeocdn.com/video/936667051-1647ace66c627d4a2382185e0dae8deb830309bfddd53f8b2367b2f91e92ed0e-d_1280',
'series_id': '52733',
'uploader_url': 'h... | ```suggestion
module = next((m for m in course.get('learning_modules') or []
``` | 'title': 'Azure Virtual Network IP Addressing',
'thumbnail': 'https://i.vimeocdn.com/video/936667051-1647ace66c627d4a2382185e0dae8deb830309bfddd53f8b2367b2f91e92ed0e-d_1280',
'series_id': '52733',
'uploader_url': 'https://vimeo.com/user30867300',
'duration': 4... | @@ -0,0 +1,147 @@
+# coding: utf-8
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata
+)
+
+
+class CybraryBaseIE(InfoExtractor):
+ _API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
+ _ENDPOINTS = {
+ ... | yt_dlp/extractor/cybrary.py | 26 | Python | 0.571 | suggestion | 90 | 51 | 51 | false | [Cybrary] Add extractor | 3,264 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
urlencode_postdata
)
class CybraryBaseIE(InfoExtractor):
_API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
_ENDPOINTS = {
'course': 'https://app.cybrary.it/courses/api/catalog/browse/course/{}',
'course_enrollment': 'https://app.cybrary.it/courses/api/catalog/{}/enrollment',
'en... | since login is mandatory, add this:
```suggestion
def _real_initialize(self):
if not self._TOKEN:
self.raise_login_required(method='password')
``` | urlencode_postdata
)
class CybraryBaseIE(InfoExtractor):
_API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
_ENDPOINTS = {
'course': 'https://app.cybrary.it/courses/api/catalog/browse/course/{}',
'course_enrollment': 'https://app.cybrary.it/courses/api/catalog/{}/enrollment',
'en... | @@ -0,0 +1,147 @@
+# coding: utf-8
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata
+)
+
+
+class CybraryBaseIE(InfoExtractor):
+ _API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
+ _ENDPOINTS = {
+ ... | yt_dlp/extractor/cybrary.py | 26 | Python | 0.714 | suggestion | 179 | 51 | 51 | false | [Cybrary] Add extractor | 3,264 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
smuggle_url,
str_or_none,
traverse_obj,
urlencode_postdata
)
class CybraryBaseIE(InfoExtractor):
_API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
_ENDPOINTS = {
'course': 'https://app.cybrary.it/courses/api/catalog/browse/course/{}',
'course_enrollment': 'https://app.cybrar... | ```suggestion
CybraryBaseIE._TOKEN = self._download_json(
f'https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?key={self._API_KEY}',
None, data=urlencode_postdata({'email': username, 'password': password, 'returnSecureToken': True}),
note='Logging in')[... | smuggle_url,
str_or_none,
traverse_obj,
urlencode_postdata
)
class CybraryBaseIE(InfoExtractor):
_API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
_ENDPOINTS = {
'course': 'https://app.cybrary.it/courses/api/catalog/browse/course/{}',
'course_enrollment': 'https://app.cybrar... | @@ -0,0 +1,147 @@
+# coding: utf-8
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata
+)
+
+
+class CybraryBaseIE(InfoExtractor):
+ _API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
+ _ENDPOINTS = {
+ ... | yt_dlp/extractor/cybrary.py | 26 | Python | 0.857 | suggestion | 335 | 51 | 51 | false | [Cybrary] Add extractor | 3,264 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
'id': 898,
'title': 'AZ-500: Microsoft Azure Security Technologies',
'description': 'md5:69549d379c0fc1dec92926d4e8b6fbd4'
},
'playlist_count': 59
}, {
'url': 'https://app.cybrary.it/browse/course/cybrary-orientation',
'info_dict': {
'i... | ```suggestion
return self.playlist_result(
entries,
traverse_obj(course, ('content_item', 'id'), expected_type=str_or_none),
course.get('title'), course.get('short_description'))
```
id shouldn't be a number | },
'playlist_count': 59
}, {
'url': 'https://app.cybrary.it/browse/course/cybrary-orientation',
'info_dict': {
'id': 1245,
'title': 'Cybrary Orientation',
'description': 'md5:9e69ff66b32fe78744e0ad4babe2e88e'
},
'playlist_count': 4
... | @@ -0,0 +1,147 @@
+# coding: utf-8
+from .common import InfoExtractor
+
+from ..utils import (
+ ExtractorError,
+ smuggle_url,
+ str_or_none,
+ traverse_obj,
+ urlencode_postdata
+)
+
+
+class CybraryBaseIE(InfoExtractor):
+ _API_KEY = 'AIzaSyCX9ru6j70PX2My1Eq6Q1zoMAhuTdXlzSw'
+ _ENDPOINTS = {
+ ... | yt_dlp/extractor/cybrary.py | 26 | Python | 1 | suggestion | 257 | 27 | 26 | false | [Cybrary] Add extractor | 3,264 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aaearon |
tags = traverse_obj(api_data, ('tag', 'items', ..., 'name'))
return {
'id': video_id,
'_api_data': api_data,
'title': get_video_info(('originalTitle', 'title')) or self._og_search_title(webpage, default=None),
'formats': formats,
'thumbnai... | currently owner is being used as `uploader` and channel/community as `channel` | tags = [x for x in kwds.split(',') if x]
if not tags:
# find in json (logged in)
tags = traverse_obj(api_data, ('tag', 'items', ..., 'name'))
thumb_prefs = qualities(['url', 'middleUrl', 'largeUrl', 'player', 'ogp'])
return {
'id': video_... | @@ -430,18 +433,25 @@ def get_video_info(*items, get_first=True, **kwargs):
# find in json (logged in)
tags = traverse_obj(api_data, ('tag', 'items', ..., 'name'))
+ thumb_prefs = qualities(['url', 'middleUrl', 'largeUrl', 'player', 'ogp'])
+
return {
'id': video... | yt_dlp/extractor/niconico.py | 26 | Python | 0.429 | suggestion | 78 | 51 | 51 | false | [niconico] Fix extraction of thumbnails and uploader | 3,266 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
if not tags:
# use keywords and split with comma (not logged in)
kwds = self._html_search_meta('keywords', webpage, default=None)
if kwds:
tags = [x for x in kwds.split(',') if x]
if not tags:
# find in json (logged in)
... | That was a really good job to support multiple thumbnails. Thanks @Lesmiscore | # use og:video:tag (not logged in)
og_video_tags = re.finditer(r'<meta\s+property="og:video:tag"\s*content="(.*?)">', webpage)
tags = list(filter(None, (clean_html(x.group(1)) for x in og_video_tags)))
if not tags:
# use keywords and split with comma (not ... | @@ -430,18 +433,25 @@ def get_video_info(*items, get_first=True, **kwargs):
# find in json (logged in)
tags = traverse_obj(api_data, ('tag', 'items', ..., 'name'))
+ thumb_prefs = qualities(['url', 'middleUrl', 'largeUrl', 'player', 'ogp'])
+
return {
'id': video... | yt_dlp/extractor/niconico.py | 26 | Python | 0.214 | suggestion | 78 | 51 | 51 | false | [niconico] Fix extraction of thumbnails and uploader | 3,266 | yt-dlp/yt-dlp | 132,642 | Python | CXwudi | Lesmiscore |
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
_PATH_MAP = {
'episodes': 'episode',
}
def _real_extract(self, url):
path, video_id = self._match_valid_url(url).groups()
if path == 'lp':
webpage = self._download_webp... | As new l.40 didn't crash (`p_id`, `r_id` are both strings), `api_response` is a valid `dict` and this could be just `str_or_none(api_response.get('description'))`. | },
'add_ie': ['BrightcoveNew'],
}, {
'skip': 'videos are only available for 7 days',
'url': 'https://tver.jp/lp/episodes/ep6f16g26p',
'info_dict': {
# sorry but this is "correct"
'title': '4月11日(月)23時06分 ~ 放送予定',
'description': 'md5:4029cc5... | @@ -5,72 +5,45 @@
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
- ExtractorError,
int_or_none,
- remove_start,
smuggle_url,
traverse_obj,
)
class TVerIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?tver\.jp/(?P<path>corner|episode|feature... | yt_dlp/extractor/tver.py | 26 | Python | 0.571 | bug | 163 | 31 | 51 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Lesmiscore |
# videos are only available for 7 days
_TESTS = [{
'url': 'https://tver.jp/episodes/ephss8yveb',
'only_matching': True,
}]
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
def _real_extract(self, url):
video_id = self._match_... | since these are mandatory fields, traverse_obj is not needed
```suggestion
p_id, r_id = video_info['video']['accountID'], video_info['video']['videoRefID']
return {
'_type': 'url_transparent',
'url': smuggle_url(self.BRIGHTCOVE_URL_TEMPLATE % (p_id, f'ref:{r_id}'),... | _TESTS = [{
'skip': 'videos are only available for 7 days',
'url': 'https://tver.jp/episodes/ephss8yveb',
'info_dict': {
'title': '#44 料理と値段と店主にびっくり オモてなしすぎウマい店 2時間SP',
'description': 'md5:66985373a66fed8ad3cd595a3cfebb13',
},
'add_ie': ['BrightcoveNew... | @@ -3,75 +3,40 @@
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
- ExtractorError,
- int_or_none,
- remove_start,
smuggle_url,
+ str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?tver\.jp/(?P<path>... | yt_dlp/extractor/tver.py | 26 | Python | 0.929 | suggestion | 485 | 29 | 51 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
from ..utils import (
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?P<path>corner|episodes?|feature|lp|tokyo2020/video)/(?P<id>[a-zA-Z0-9]+)'
# videos are only available for 7 days
_TESTS = [{
'url': 'https://tver.jp... | With https://tver.jp/episodes/ep6f16g26p, there's no `videoRefID`:
```py
{
...
'video': {'accountID': '3971130137001',
'channelID': 'tx',
'playerID': 'Eyc2R2Jow',
'videoID': '6302378806001'},
...
}
```
Apparently `videoID` isn't a good substitute:
```ShellSession
[brightc... | ExtractorError,
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo2020/video)/)+(?P<id>[a-zA-Z0-9]+)'
_TESTS = [{
'skip': 'videos are only available for 7 days',
... | @@ -3,75 +3,40 @@
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
- ExtractorError,
- int_or_none,
- remove_start,
smuggle_url,
+ str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?tver\.jp/(?P<path>... | yt_dlp/extractor/tver.py | 26 | Python | 0.929 | suggestion | 452 | 38 | 51 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Lesmiscore |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?P<path>corner|episodes?|feature|lp|tokyo2020/video)/(?P<id>[a-zA-Z0-9]+)... | Is `tver.jp/lp/{video_id}` still a valid pattern?
In the `api_response` I saw it being used like a shortcut `tver.jp/lp/episodes/{video_id}`.
Perhaps:
`r'https?://(?:www\.)?tver\.jp/(?:lp/)?(?P<path>corner|episodes?|feature|tokyo2020/video)/(?P<id>[a-zA-Z0-9]+)'`?
| # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo202... | @@ -3,75 +3,40 @@
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
- ExtractorError,
- int_or_none,
- remove_start,
smuggle_url,
+ str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?tver\.jp/(?P<path>... | yt_dlp/extractor/tver.py | 14 | Python | 0.643 | question | 273 | 39 | 39 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Lesmiscore |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?P<path>corner|episodes?|feature|lp|tokyo2020/video)/(?P<id>[a-zA-Z0-9]+)... | With https://tver.jp/corner/f0103888, I get 403 for https://statics.tver.jp/content/corner/f0103888.json. Apparently it redirects to the episodes URL as below (need to extract from `location.href="{url}"`, load that URL and get the resulting redirected URL). Perhaps we need to chase at least one level of redirection? | 'url': 'https://tver.jp/lp/f0033031',
'only_matching': True,
}]
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
_PLATFORM_UID = None
_PLATFORM_TOKEN = None
def _real_initialize(self):
create_response = self._download_json(
... | @@ -3,75 +3,40 @@
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
- ExtractorError,
- int_or_none,
- remove_start,
smuggle_url,
+ str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
- _VALID_URL = r'https?://(?:www\.)?tver\.jp/(?P<path>... | yt_dlp/extractor/tver.py | 26 | Python | 0.643 | refactor | 318 | 43 | 51 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Lesmiscore |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?:lp|corner|series|episodes?|feature|tok... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo2020/video)/)+(?P<id>[a-zA-Z0-9]+)'
```
see next comment | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo202... | @@ -1,77 +1,99 @@
# coding: utf-8
from __future__ import unicode_literals
+import re
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
ExtractorError,
- int_or_none,
- remove_start,
smuggle_url,
+ str_or_none,
traverse_obj,
)
class TVerIE(Info... | yt_dlp/extractor/tver.py | 18 | Python | 0.857 | suggestion | 172 | 43 | 43 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
'add_ie': ['BrightcoveNew'],
}, {
'url': 'https://tver.jp/corner/f0103888',
'only_matching': True,
}, {
'url': 'https://tver.jp/lp/f0033031',
'only_matching': True,
}]
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%... | ```suggestion
video_id, video_type = self._match_valid_url(url).group('id', 'type')
if type in {'episode', 'episodes', 'series'}:
``` | }, {
'url': 'https://tver.jp/lp/f0033031',
'only_matching': True,
}]
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
_PLATFORM_UID = None
_PLATFORM_TOKEN = None
def _real_initialize(self):
create_response = self._downloa... | @@ -1,77 +1,99 @@
# coding: utf-8
from __future__ import unicode_literals
+import re
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
ExtractorError,
- int_or_none,
- remove_start,
smuggle_url,
+ str_or_none,
traverse_obj,
)
class TVerIE(Info... | yt_dlp/extractor/tver.py | 26 | Python | 0.857 | suggestion | 152 | 51 | 51 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
}, {
'url': 'https://tver.jp/lp/f0033031',
'only_matching': True,
}]
BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
_PLATFORM_UID = None
_PLATFORM_TOKEN = None
def _real_initialize(self):
create_response = self._downloa... | ```suggestion
webpage = self._download_webpage(url, video_id, note='Resolving to new URL')
video_id = self._match_id(self._search_regex(
(r'canonical"\s*href="(https?://tver\.jp/[^"]+)"', r'&link=(https?://tver\.jp/[^?&]+)[?&]'),
``` | BRIGHTCOVE_URL_TEMPLATE = 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
_PLATFORM_UID = None
_PLATFORM_TOKEN = None
def _real_initialize(self):
create_response = self._download_json(
'https://platform-api.tver.jp/v2/api/platform_users/browser/create', None... | @@ -1,77 +1,99 @@
# coding: utf-8
from __future__ import unicode_literals
+import re
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
ExtractorError,
- int_or_none,
- remove_start,
smuggle_url,
+ str_or_none,
traverse_obj,
)
class TVerIE(Info... | yt_dlp/extractor/tver.py | 26 | Python | 0.786 | suggestion | 277 | 51 | 51 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Lesmiscore |
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo2020/video)/)+(?P<id>[a-zA-Z0-9]+)'
_TESTS = [{
'skip': 'videos are only available for 7 days',
'url': 'https://tver.jp/episodes/ephss8yveb',
'info_dict': {
'title': '#44 料理と値段と店主にび... | Although this isn't part of the PR, isn't the ability to populate `BRIGHTCOVE_URL_TEMPLATE` something that should be a method or variable of the `BrightCoveNewIE` class and imported from there? | _VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo2020/video)/)+(?P<id>[a-zA-Z0-9]+)'
_TESTS = [{
'skip': 'videos are only available for 7 days',
'url': 'https://tver.jp/episodes/ephss8yveb',
'info_dict': {
'title': '#44 料理と値段と店主にび... | @@ -1,77 +1,94 @@
# coding: utf-8
from __future__ import unicode_literals
-
from .common import InfoExtractor
-from ..compat import compat_str
from ..utils import (
ExtractorError,
- int_or_none,
- remove_start,
smuggle_url,
+ str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):... | yt_dlp/extractor/tver.py | 26 | Python | 0.571 | question | 193 | 51 | 51 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Lesmiscore |
from .common import InfoExtractor
from ..utils import (
ExtractorError,
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo2020/video)/)+(?P<id>[a-zA-Z0-9]+)'
_TESTS = [{
... | The description values seem to be unstable. I'm getting an extra \U3000 (ideographic space) in this bit `る! テ` giving `md5:4029cc5f4b1e8090dfc5b7bd2bc5cd0b`, but not reliably. Also `u'md5:66985373a66fed8ad3cd595a3cfebb13` in the 1st test. | ExtractorError,
smuggle_url,
str_or_none,
traverse_obj,
)
class TVerIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tver\.jp/(?:(?P<type>lp|corner|series|episodes?|feature|tokyo2020/video)/)+(?P<id>[a-zA-Z0-9]+)'
_TESTS = [{
'skip': 'videos are only available for 7 days',
... | @@ -28,7 +28,7 @@ class TVerIE(InfoExtractor):
'info_dict': {
# sorry but this is "correct"
'title': '4月11日(月)23時06分 ~ 放送予定',
- 'description': '吉祥寺の格安シェアハウスに引っ越して来た高校教師の安彦聡(増田貴久)や、元ファッション誌編集長の大庭桜(田中みな実)など6人。鍵が掛かった部屋に絶対入らないことが絶対ルール。奇妙な共同生活が今始まる! テレビ東京にて4月11日(月)夜11時6分放送スタート!'... | yt_dlp/extractor/tver.py | 26 | Python | 0.571 | suggestion | 238 | 51 | 51 | false | [TVer] Fix extractor | 3,268 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | Lesmiscore |
_TESTS = [{
# m3u8 with subtitles
'url': 'https://elonet.finna.fi/Record/kavi.elonet_elokuva_107867',
'md5': '8efc954b96c543711707f87de757caea',
'info_dict': {
'id': '107867',
'ext': 'mp4',
'title': 'Valkoinen peura',
'description': 'Va... | ```suggestion
'skip_download': 'dash',
```
fragmented streams cannot be download tested | 'thumbnail': r're:^https?://elonet\.finna\.fi/Cover/Show\?id=kavi\.elonet_elokuva_107867.+',
'description': 'md5:bded4201c9677fab10854884fe8f7312',
},
'params': {'skip_download': 'dash'},
}, {
# DASH with subtitles
'url': 'https://elonet.finna.fi/Record/kavi.e... | @@ -34,7 +34,26 @@ class ElonetIE(InfoExtractor):
'title': 'Minulla on tiikeri',
'description': 'Pienellä pojalla, joka asuu kerrostalossa, on kotieläimenä tiikeri. Se on kuitenkin salaisuus. Kerrostalon räpätäti on Kotilaisen täti, joka on aina vali...',
'thumbnail': 'https://elo... | yt_dlp/extractor/elonet.py | 26 | Python | 0.714 | suggestion | 102 | 51 | 51 | false | [elonet] Fix extractor | 3,277 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Vocaned |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_get,
)
from ..compat import compat_str
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_T... | use regex. No need for the test to be so specific | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import determine_ext
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://elonet.finna.fi/Record/kavi.elon... | @@ -23,8 +22,9 @@ class ElonetIE(InfoExtractor):
'ext': 'mp4',
'title': 'Valkoinen peura',
'description': 'Valkoinen peura (1952) on Erik Blombergin ohjaama ja yhdessä Mirjami Kuosmasen kanssa käsikirjoittama tarunomainen kertomus valkoisen peuran hahmossa lii...',
- 't... | yt_dlp/extractor/elonet.py | 25 | Python | 0.143 | suggestion | 49 | 50 | 50 | false | [elonet] Fix extractor | 3,277 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Vocaned |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
try_get,
)
from ..compat import compat_str
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
... | so? The test still works, no? Just remove the comment above
PS: The md5 test will likely fail. You can remove it and add `skip_download` | from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import determine_ext
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://elonet.finna.fi/Record/kavi.elonet_elokuva_10786... | @@ -23,8 +22,9 @@ class ElonetIE(InfoExtractor):
'ext': 'mp4',
'title': 'Valkoinen peura',
'description': 'Valkoinen peura (1952) on Erik Blombergin ohjaama ja yhdessä Mirjami Kuosmasen kanssa käsikirjoittama tarunomainen kertomus valkoisen peuran hahmossa lii...',
- 't... | yt_dlp/extractor/elonet.py | 26 | Python | 0.571 | bug | 139 | 51 | 51 | false | [elonet] Fix extractor | 3,277 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Vocaned |
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
# m3u8 with subtitles
'url': 'https://elonet.finna.fi/Record/kavi.elonet_elokuva_107867',
'md5': '8efc954b96c543711707f87de757caea',
'info_dict': {
... | this actually shouldn't be in the test. I'll adjust the test runner accordingly
```suggestion
``` | 'info_dict': {
'id': '107867',
'ext': 'mp4',
'title': 'Valkoinen peura',
'thumbnail': r're:^https?://elonet\.finna\.fi/Cover/Show\?id=kavi\.elonet_elokuva_107867.+',
'description': 'md5:bded4201c9677fab10854884fe8f7312',
},
'params': {'... | @@ -34,7 +34,26 @@ class ElonetIE(InfoExtractor):
'title': 'Minulla on tiikeri',
'description': 'Pienellä pojalla, joka asuu kerrostalossa, on kotieläimenä tiikeri. Se on kuitenkin salaisuus. Kerrostalon räpätäti on Kotilaisen täti, joka on aina vali...',
'thumbnail': 'https://elo... | yt_dlp/extractor/elonet.py | 26 | Python | 0.643 | suggestion | 99 | 51 | 51 | false | [elonet] Fix extractor | 3,277 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Vocaned |
'info_dict': {
'id': '117396',
'ext': 'mp4',
'title': 'Sampo',
'description': 'Aleksandr Ptushkon ohjaama, neuvostoliittolais-suomalainen yhteistuotanto Sampo (1959) on Kalevalan tarustoon pohjautuva fantasiaelokuva. Pohjolan emäntä...',
'thumbnail': '... | ```suggestion
r'id=\'video-data\'[^>]+data-video-sources="(.+?)"', webpage, 'json')
```
is this right? | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import determine_ext
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://elonet.finna.fi/Record/kavi.elon... | @@ -49,35 +68,22 @@ def _real_extract(self, url):
r'<meta .*property="og:image" .*content="(.+?)"', webpage, 'thumbnail')
json_s = self._html_search_regex(
- r'data-video-sources="(.+?)"', webpage, 'json')
+ r'id=\'video-data\'.+?data-video-sources="(.+?)"', webpage, '... | yt_dlp/extractor/elonet.py | 26 | Python | 0.714 | question | 117 | 51 | 69 | false | [elonet] Fix extractor | 3,277 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Vocaned |
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(
r'<meta .*property="og:title" .*content="(.+?)"', webpage, 'title')
description = self._html_search_regex(
r'<meta .*property="og:description... | idk how this passed previous review, but this shouldn't be an error. Just print a warning | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import determine_ext
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://elonet.finna.fi/Record/kavi.elon... | @@ -49,35 +68,22 @@ def _real_extract(self, url):
r'<meta .*property="og:image" .*content="(.+?)"', webpage, 'thumbnail')
json_s = self._html_search_regex(
- r'data-video-sources="(.+?)"', webpage, 'json')
+ r'id=\'video-data\'.+?data-video-sources="(.+?)"', webpage, '... | yt_dlp/extractor/elonet.py | 26 | Python | 0.429 | suggestion | 89 | 37 | 69 | false | [elonet] Fix extractor | 3,277 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Vocaned |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
try_get,
)
from ..compat import compat_str
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
... | skip_download means md5 test is not done
```suggestion
```
Where did you even get this? | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import determine_ext
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
'url': 'https://elonet.finna.fi/Record/kavi.elon... | @@ -15,26 +12,46 @@
class ElonetIE(InfoExtractor):
_VALID_URL = r'https?://elonet\.finna\.fi/Record/kavi\.elonet_elokuva_(?P<id>[0-9]+)'
_TESTS = [{
- # m3u8 with subtitles
'url': 'https://elonet.finna.fi/Record/kavi.elonet_elokuva_107867',
- 'md5': '8efc954b96c543711707f87de757caea',
... | yt_dlp/extractor/elonet.py | 16 | Python | 0.571 | question | 90 | 41 | 41 | false | [elonet] Fix extractor | 3,277 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | Vocaned |
if data.get('memberGated') is True:
_token = self._get_bearer_token(content_id)
headers = {'Authorization': _token}
_video_url = self._download_json(
data.get('playbackApiEndpoint'), content_id, 'Downloading video JSON',
headers=headers).get('source')
... | ```suggestion
'subtitles': {'en': [{'url': data['captionUrl']}]} if data.get('captionUrl') else None,
```
`determine_ext` will be applied by core code | if data.get('memberGated') is True:
_token = self._get_bearer_token(content_id)
headers = {'Authorization': _token}
_video_url = self._download_json(
data.get('playbackApiEndpoint'), content_id, 'Downloading video JSON',
headers=headers).get('source')
... | @@ -62,27 +86,44 @@ def _get_bearer_token(self, video_id):
def _real_extract(self, url):
content_id = self._match_id(url)
- _token = self._get_bearer_token(content_id)
data = self._download_json(
'https://10play.com.au/api/v1/videos/' + content_id, content_id)
+ heade... | yt_dlp/extractor/tenplay.py | 26 | Python | 0.714 | suggestion | 165 | 41 | 32 | false | [tenplay] Add subtitles and fix info | 3,280 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | aarubui |
'ext': 'mp4',
},
'skip': 'No trailer for this movie.',
}, {
'url': 'https://www.moviepilot.de/movies/muellers-buero/',
'info_dict': {
'id': 'x7xcw1i',
# 'id': 'muellers-buero',
'title': 'Müllers Büro', # test umlauts
'ext':... | this already exists as `self._html_search_meta` | },
'skip': 'No trailer for this movie.',
}, {
'url': 'https://www.moviepilot.de/movies/muellers-buero/',
'info_dict': {
'id': 'x7xcw1i',
'display_id': 'muellers-buero',
'title': 'Müllers Büro',
'ext': 'mp4',
'description': '... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.214 | suggestion | 47 | 51 | 48 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
unescapeHTML,
)
class MoviepilotIE(InfoExtractor):
_IE_NAME = "moviepilot"
_IE_DESC = "Moviepilot trailer"
_VALID_URL = r'https?://(?... | use single quotes everywhere. Make sure you have read the contributing guidelines | # coding: utf-8
from __future__ import unicode_literals
from .dailymotion import DailymotionIE
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
try_get,
)
import re
class MoviepilotIE(InfoExtractor):
_IE_NAME = 'moviepilot'
_IE_DESC = 'Moviepilot trailer'
_VALID_URL = r'htt... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot" | yt_dlp/extractor/moviepilot.py | 14 | Python | 0.286 | suggestion | 81 | 39 | 39 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
unescapeHTML,
)
class MoviepilotIE(InfoExtractor):
_IE_NAME = "moviepilot"
_IE_DESC = "Moviepilot trailer"
_VALID_URL = r'https?://(?... | ```suggestion
_VALID_URL = r'https?://(?:www\.)?moviepilot\.de/movies/(?P<id>[^/]+)'
```
it doesnt do anything | # coding: utf-8
from __future__ import unicode_literals
from .dailymotion import DailymotionIE
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
try_get,
)
import re
class MoviepilotIE(InfoExtractor):
_IE_NAME = 'moviepilot'
_IE_DESC = 'Moviepilot trailer'
_VALID_URL = r'htt... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 16 | Python | 0.714 | suggestion | 117 | 41 | 41 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
unescapeHTML,
)
class MoviepilotIE(InfoExtractor):
_IE_NAME = "moviepilot"
_IE_DESC = "Moviepilot trailer"
_VALID_URL = r'https?://(?... | id is always returned by the inner extractor. You can return this as `display_id` if you wish | # coding: utf-8
from __future__ import unicode_literals
from .dailymotion import DailymotionIE
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
try_get,
)
import re
class MoviepilotIE(InfoExtractor):
_IE_NAME = 'moviepilot'
_IE_DESC = 'Moviepilot trailer'
_VALID_URL = r'htt... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 21 | Python | 0.429 | refactor | 93 | 46 | 46 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
},
}]
def _get_property(self, name, webpage, fatal=True):
return self._search_regex(f'meta itemprop="{name}" content="(.*?)"', webpage, name, fatal=fatal)
def _real_extract(self, url):
video_id = self._match_id(url)
# normalize url
url = f"https://www.moviepilot.de... | You should ask for clarifications on github, not put as comment in code 😐
To answer this, use regex to either convert this into a parsable format or even directly convert to seconds | }]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', video_id)
duration = try_get(
re.match(r'P(?P<hours>\d+)H(?P<mins>\d+)M(?P<secs>\d+)S',
self._html_... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.429 | style | 185 | 33 | 27 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
'description': 'md5:57501251c05cdc61ca314b7633e0312e',
'timestamp': 1287584475,
'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': 'https://s1.dmcdn.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
... | Read "Trailing parentheses" section of code style guide | 'timestamp': 1287584475,
'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
'like_count': int,
'view_count': int,
... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.214 | style | 55 | 44 | 38 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
'title': 'Müllers Büro', # test umlauts
'ext': 'mp4',
'description': 'md5:57501251c05cdc61ca314b7633e0312e',
'timestamp': 1287584475,
'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': 'https://s1.dmcdn... | ```suggestion
webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', video_id)
``` | 'ext': 'mp4',
'description': 'md5:57501251c05cdc61ca314b7633e0312e',
'timestamp': 1287584475,
'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaMes1WfAm1d6maq_/x720',
'u... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.714 | suggestion | 126 | 46 | 40 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
'timestamp': 1287584475,
'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': 'https://s1.dmcdn.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
'like_count': int,
'view_count': int,
't... | ```suggestion
'ie_key': DailymotionIE.ie_key(),
``` | 'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
'like_count': int,
'view_count': int,
'tags': ['Alle Trailer', 'Movie'... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.571 | suggestion | 69 | 43 | 37 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
return self._search_regex(f'meta itemprop="{name}" content="(.*?)"', webpage, name, fatal=fatal)
def _real_extract(self, url):
video_id = self._match_id(url)
# normalize url
url = f"https://www.moviepilot.de/movies/{video_id}/trailer"
webpage = self._download_webpage(url, ... | ```suggestion
'timestamp': parse_iso8601(self._get_property('uploadDate', webpage, fatal=False), delimiter=' '),
``` | # coding: utf-8
from __future__ import unicode_literals
from .dailymotion import DailymotionIE
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
try_get,
)
import re
class MoviepilotIE(InfoExtractor):
_IE_NAME = 'moviepilot'
_IE_DESC = 'Moviepilot trailer'
_VALID_URL = r'htt... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.714 | suggestion | 134 | 29 | 116 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
def _real_extract(self, url):
video_id = self._match_id(url)
# normalize url
url = f"https://www.moviepilot.de/movies/{video_id}/trailer"
webpage = self._download_webpage(url, video_id)
return {'_type': 'url_transparent',
'ie_key': 'Dailymotion',
... | since the video has multiple formats, this is wrong | # coding: utf-8
from __future__ import unicode_literals
from .dailymotion import DailymotionIE
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
try_get,
)
import re
class MoviepilotIE(InfoExtractor):
_IE_NAME = 'moviepilot'
_IE_DESC = 'Moviepilot trailer'
_VALID_URL = r'htt... | @@ -0,0 +1,121 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .common import InfoExtractor
+from ..utils import (
+ int_or_none,
+ parse_duration,
+ parse_iso8601,
+ unescapeHTML,
+)
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = "moviepilot"
+ _IE_DESC = "Moviepilot traile... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.214 | bug | 51 | 27 | 116 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
'upload_date': '20101020',
'thumbnail': 'https://s1.dmcdn.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
'like_count': int,
'view_count': int,
'tags': ['Alle Trailer', 'Movie', 'Verleih'],
'uploader_id': 'x6nd9k',
},
... | ```suggestion
duration = try_get(
re.match(r'P(?P<hours>\d+)H(?P<mins>\d+)M(?P<secs>\d+)S',
self._html_search_meta('duration', webpage, fatal=False) or ''),
lambda mobj: sum(float(x) * y for x, y in zip(mobj.groups(), (3600, 60, 1))))
```
(can be split into 2 e... | 'upload_date': '20101020',
'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
'like_count': int,
'view_count': int,
'tags': ['Alle Trailer', 'Movie', 'Verleih'],
'uploader_id': 'x6nd9k',
... | @@ -0,0 +1,119 @@
+# coding: utf-8
+from __future__ import unicode_literals
+
+from .dailymotion import DailymotionIE
+from .common import InfoExtractor
+from ..utils import (
+ parse_iso8601,
+ unescapeHTML,
+)
+
+import re
+
+
+class MoviepilotIE(InfoExtractor):
+ _IE_NAME = 'moviepilot'
+ _IE_DESC = 'Mov... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.786 | suggestion | 363 | 39 | 35 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
from __future__ import unicode_literals
from .dailymotion import DailymotionIE
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
try_get,
unescapeHTML,
)
import re
class MoviepilotIE(InfoExtractor):
_IE_NAME = 'moviepilot'
_IE_DESC = 'Moviepilot trailer'
_VALID_URL = r'h... | ```suggestion
'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaXev1VvzitVZMFsR/x720',
```
same elsewhere | from __future__ import unicode_literals
from .dailymotion import DailymotionIE
from .common import InfoExtractor
from ..utils import (
parse_iso8601,
try_get,
)
import re
class MoviepilotIE(InfoExtractor):
_IE_NAME = 'moviepilot'
_IE_DESC = 'Moviepilot trailer'
_VALID_URL = r'https?://(?:www\.)?... | @@ -23,7 +24,7 @@ class MoviepilotIE(InfoExtractor):
'display_id': 'interstellar-2',
'ext': 'mp4',
'title': 'Interstellar',
- 'thumbnail': 'https://s1.dmcdn.net/v/SaXev1VvzitVZMFsR/x720',
+ 'thumbnail': r're:https://.*\.dmcdn\.net/v/SaXev1VvzitVZMFsR/x720', | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.714 | suggestion | 116 | 51 | 51 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
'description': 'md5:57501251c05cdc61ca314b7633e0312e',
'timestamp': 1287584475,
'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': r're:https://.*\.dmcdn\.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
... | ```suggestion
description = _html_search_regex(
'<meta[^>]+itemprop="description"[^>]+content="([^>"])"', webpage, 'description', fatal=False)
``` | 'timestamp': 1287584475,
'age_limit': 0,
'duration': 82,
'upload_date': '20101020',
'thumbnail': r're:https://\w+\.dmcdn\.net/v/SaMes1WfAm1d6maq_/x720',
'uploader': 'Moviepilot',
'like_count': int,
'view_count': int,
... | @@ -89,31 +90,27 @@ class MoviepilotIE(InfoExtractor):
},
}]
- def _get_property(self, name, webpage, fatal=True):
- return self._search_regex(f'meta itemprop="{name}" content="(.*?)"', webpage, name, fatal=fatal)
-
def _real_extract(self, url):
video_id = self._match_id(url)
... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.714 | suggestion | 169 | 39 | 38 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
'view_count': int,
'tags': ['Alle Trailer', 'Movie', 'Verleih'],
'uploader_id': 'x6nd9k',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', vide... | ```suggestion
'thumbnail': self._html_search_meta('thumbnailURL', webpage),
```
that is the default! | 'tags': ['Alle Trailer', 'Movie', 'Verleih'],
'uploader_id': 'x6nd9k',
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', video_id)
duration = try_g... | @@ -89,31 +90,27 @@ class MoviepilotIE(InfoExtractor):
},
}]
- def _get_property(self, name, webpage, fatal=True):
- return self._search_regex(f'meta itemprop="{name}" content="(.*?)"', webpage, name, fatal=fatal)
-
def _real_extract(self, url):
video_id = self._match_id(url)
... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.714 | suggestion | 115 | 31 | 30 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
},
}]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', video_id)
duration = try_get(
re.match(r'P(?P<hours>\d+)H(?P<mins>\d+)M(?P<secs>\d+)S',
... | ```suggestion
'timestamp': parse_iso8601(self._html_search_meta('uploadDate', webpage), delimiter=' ')
``` | }]
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(f'https://www.moviepilot.de/movies/{video_id}/trailer', video_id)
duration = try_get(
re.match(r'P(?P<hours>\d+)H(?P<mins>\d+)M(?P<secs>\d+)S',
self._html_... | @@ -89,31 +90,27 @@ class MoviepilotIE(InfoExtractor):
},
}]
- def _get_property(self, name, webpage, fatal=True):
- return self._search_regex(f'meta itemprop="{name}" content="(.*?)"', webpage, name, fatal=fatal)
-
def _real_extract(self, url):
video_id = self._match_id(url)
... | yt_dlp/extractor/moviepilot.py | 26 | Python | 0.714 | suggestion | 120 | 28 | 27 | false | [Moviepilot] Add extractor | 3,282 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | panatexxa |
# coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_xpath
from ..utils import (
date_from_str,
determine_ext,
ExtractorError,
int_or_none,
qualities,
traverse_obj,
unified_strdate,
unified_timestamp,
update... | ```suggestion
user_id, user_type = self._match_valid_url(url).group('id', 'slug_type')
user_type = user_type or 'all'
``` | }, {
'url': 'https://bj.afreecatv.com/parang1995/vods/highlight',
'info_dict': {
'_type': 'playlist',
'id': 'parang1995',
'title': 'parang1995 - highlight',
},
'playlist_count': 997,
}, {
'url': 'https://bj.afreecatv.com/ryuryu24/vods',... | @@ -482,3 +479,62 @@ def _real_extract(self, url):
'formats': formats,
'is_live': True,
}
+
+
+class AfreecaTVUserIE(InfoExtractor):
+ IE_NAME = 'afreecatv:user'
+ _VALID_URL = r'https?://bj\.afreeca(?:tv)?\.com/(?P<id>[^/]+)/vods/?(?P<slug_type>[^/]+)?'
+ _TESTS = [{
+ ... | yt_dlp/extractor/afreecatv.py | 26 | Python | 0.929 | suggestion | 140 | 485 | 42 | false | [AfreecaTV] Improve extractor | 3,286 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
}, {
'url': 'http://www.imdb.com/videoplayer/vi1562949145',
'only_matching': True,
}, {
'url': 'http://www.imdb.com/title/tt4218696/videoplayer/vi2608641561',
'only_matching': True,
}, {
'url': 'https://www.imdb.com/list/ls009921623/videoplayer/vi260482329',
'... | what's with this unreadable indentation... | }, {
'url': 'http://www.imdb.com/videoplayer/vi1562949145',
'only_matching': True,
}, {
'url': 'http://www.imdb.com/title/tt4218696/videoplayer/vi2608641561',
'only_matching': True,
}, {
'url': 'https://www.imdb.com/list/ls009921623/videoplayer/vi260482329',
'... | @@ -52,19 +64,32 @@ class ImdbIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
- data = self._download_json(
+ webpage = self._download_webpage(f'https://www.imdb.com/video/vi{video_id}', video_id)
+
+ info = self._parse_json(
+ self._search... | yt_dlp/extractor/imdb.py | 26 | Python | 0.071 | style | 42 | 51 | 51 | false | [Imdb] Improve extractor | 3,291 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
query={
'key': base64.b64encode(json.dumps({
'type': 'VIDEO_PLAYER',
'subType': 'FORCE_LEGACY',
'id': 'vi%s' % video_id,
}).encode()).decode(),
}), lambda x: x[0]['videoLegacyEncodings'])
quality... | ```suggestion
format_id = traverse_obj(encoding, ('displayName', 'value'), 'definition')
```
All your uses of try_get can actually be replaced with traverse_obj, but for this specific case in purticular, it makes no sense to use try_get | formats, subtitles = [], {}
for encoding in data:
if not encoding or not isinstance(encoding, dict):
continue
video_url = url_or_none(encoding.get('url'))
if not video_url:
continue
ext = mimetype2ext(encoding.get(
... | @@ -73,11 +98,13 @@ def _real_extract(self, url):
ext = mimetype2ext(encoding.get(
'mimeType')) or determine_ext(video_url)
if ext == 'm3u8':
- formats.extend(self._extract_m3u8_formats(
+ fmts, subs = self._extract_m3u8_formats_and_subtitles(
... | yt_dlp/extractor/imdb.py | 26 | Python | 0.857 | suggestion | 251 | 51 | 51 | false | [Imdb] Improve extractor | 3,291 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
}, {
'url': 'http://www.imdb.com/title/tt1667889/?ref_=ext_shr_eml_vi#lb-vi2524815897',
'only_matching': True,
}, {
'url': 'http://www.imdb.com/title/tt1667889/#lb-vi2524815897',
'only_matching': True,
}, {
'url': 'http://www.imdb.com/videoplayer/vi1562949145',
... | ```suggestion
title = (traverse_obj(video_info, ('name', 'value'), ('primaryTitle', 'titleText', 'text'))
or self._html_search_meta(('og:title', 'twitter:title'), webpage, default=None)
or self._html_search_regex(r'<title>(.+?)</title>', webpage, 'title'))
``` | }, {
'url': 'http://www.imdb.com/title/tt1667889/?ref_=ext_shr_eml_vi#lb-vi2524815897',
'only_matching': True,
}, {
'url': 'http://www.imdb.com/title/tt1667889/#lb-vi2524815897',
'only_matching': True,
}, {
'url': 'http://www.imdb.com/videoplayer/vi1562949145',
... | @@ -51,20 +63,25 @@ class ImdbIE(InfoExtractor):
def _real_extract(self, url):
video_id = self._match_id(url)
-
- data = self._download_json(
+ webpage = self._download_webpage(f'https://www.imdb.com/video/vi{video_id}', video_id)
+ info = self._search_nextjs_data(webpage, video_id)... | yt_dlp/extractor/imdb.py | 26 | Python | 0.786 | suggestion | 306 | 51 | 51 | false | [Imdb] Improve extractor | 3,291 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
'id': cover_id,
'url': cover_url,
})
stats_info = aweme_detail.get('statistics', {})
author_info = aweme_detail.get('author', {})
music_info = aweme_detail.get('music', {})
user_url = self._UPLOADER_URL_FORMAT % (traver... | ```suggestion
'title': aweme_detail.get('desc'),
``` | 'id': cover_id,
'url': cover_url,
})
stats_info = aweme_detail.get('statistics', {})
author_info = aweme_detail.get('author', {})
music_info = aweme_detail.get('music', {})
user_url = self._UPLOADER_URL_FORMAT % (traver... | @@ -263,7 +263,7 @@ def extract_addr(addr, add_meta={}):
return {
'id': aweme_id,
- 'title': aweme_detail['desc'],
+ 'title': aweme_detail.get('desc') or 'N/A', | yt_dlp/extractor/tiktok.py | 26 | Python | 0.571 | suggestion | 66 | 51 | 51 | false | [TikTok] Improve extractor | 3,295 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
} for url in traverse_obj(play_url, (..., 'src'), expected_type=url_or_none, default=[]) if url]
download_url = url_or_none(video_info.get('downloadAddr')) or traverse_obj(video_info, ('download', 'url'), expected_type=url_or_none)
if download_url:
formats.append({
... | why? If you failed to extract title, title should be `None` | } for url in traverse_obj(play_url, (..., 'src'), expected_type=url_or_none, default=[]) if url]
download_url = url_or_none(video_info.get('downloadAddr')) or traverse_obj(video_info, ('download', 'url'), expected_type=url_or_none)
if download_url:
formats.append({
... | @@ -339,7 +339,7 @@ def _parse_aweme_video_web(self, aweme_detail, webpage_url):
return {
'id': traverse_obj(aweme_detail, 'id', 'awemeId', expected_type=str_or_none),
- 'title': aweme_detail.get('desc'),
+ 'title': aweme_detail.get('desc') or 'N/A', | yt_dlp/extractor/tiktok.py | 26 | Python | 0.429 | bug | 59 | 51 | 51 | false | [TikTok] Improve extractor | 3,295 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
continue
raise
break
yield from post_list.get('aweme_list', [])
if not post_list.get('has_more'):
break
query['max_cursor'] = post_list['max_cursor']
def _entries_api(self, user_id, videos):
for ... | Don't unnecessarily escape chars in regex | continue
raise
break
yield from post_list.get('aweme_list', [])
if not post_list.get('has_more'):
break
query['max_cursor'] = post_list['max_cursor']
def _entries_api(self, user_id, videos):
for ... | @@ -593,7 +626,10 @@ def _real_extract(self, url):
webpage = self._download_webpage(url, user_name, headers={
'User-Agent': 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)'
})
- user_id = self._html_search_regex(r'snssdk\d*://user/profile/(\d+)', webpage,... | yt_dlp/extractor/tiktok.py | 26 | Python | 0.071 | security | 41 | 51 | 51 | false | [TikTok] Improve extractor | 3,295 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
self.report_warning('%s. Retrying...' % str(e.cause or e.msg))
continue
raise
break
yield from post_list.get('aweme_list', [])
if not post_list.get('has_more'):
break
query['max_cursor... | ```suggestion
user_id = self._html_search_regex(r'snssdk\d*://user/profile/(\d+)', webpage, 'user ID', default=None) or user_name
``` | self.report_warning('%s. Retrying...' % str(e.cause or e.msg))
continue
raise
break
yield from post_list.get('aweme_list', [])
if not post_list.get('has_more'):
break
query['max_cursor... | @@ -593,7 +626,9 @@ def _real_extract(self, url):
webpage = self._download_webpage(url, user_name, headers={
'User-Agent': 'facebookexternalhit/1.1 (+http://www.facebook.com/externalhit_uatext.php)'
})
- user_id = self._html_search_regex(r'snssdk\d*://user/profile/(\d+)', webpage, ... | yt_dlp/extractor/tiktok.py | 26 | Python | 0.786 | suggestion | 143 | 51 | 51 | false | [TikTok] Improve extractor | 3,295 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | hatienl0i2612 |
'id': cover_id,
'url': cover_url,
})
stats_info = aweme_detail.get('statistics', {})
author_info = aweme_detail.get('author', {})
music_info = aweme_detail.get('music', {})
user_url = self._UPLOADER_URL_FORMAT % (traver... | Isn't `title` still a required field? You could use:
```py
'title': aweme_detail.get('desc') or self._generic_title(url)
```
If appropriate, override the `_generic_title()` method in the extractor.
Whereas the next line should use `get()`:
```py
'description': aweme_detail.get('desc'... | 'id': cover_id,
'url': cover_url,
})
stats_info = aweme_detail.get('statistics', {})
author_info = aweme_detail.get('author', {})
music_info = aweme_detail.get('music', {})
user_url = self._UPLOADER_URL_FORMAT % (traver... | @@ -263,7 +263,7 @@ def extract_addr(addr, add_meta={}):
return {
'id': aweme_id,
- 'title': aweme_detail['desc'],
+ 'title': aweme_detail.get('desc'), | yt_dlp/extractor/tiktok.py | 26 | Python | 0.857 | refactor | 327 | 51 | 51 | false | [TikTok] Improve extractor | 3,295 | yt-dlp/yt-dlp | 132,642 | Python | dirkf | hatienl0i2612 |
api\.arte\.tv/api/player/v\d+/config/(?P<lang_2>%(langs)s)
)
/(?P<id>\d{6}-\d{3}-[AF])
''' % {'langs': ArteTVBaseIE._ARTE_LANGUAGES}
_TESTS = [{
'url': 'https://www.arte.tv/en/videos/088501-000-A/mexico-stealing-... | Using `__` doesn't really make sense here, but 🤷 | /(?P<id>\d{6}-\d{3}-[AF]|LIVE)
''' % {'langs': ArteTVBaseIE._ARTE_LANGUAGES}
_TESTS = [{
'url': 'https://www.arte.tv/en/videos/088501-000-A/mexico-stealing-petrol-to-survive/',
'only_matching': True,
}, {
'url': 'https://www.arte.tv/pl/videos/1... | @@ -46,154 +49,150 @@ class ArteTVIE(ArteTVBaseIE):
'only_matching': True,
}]
+ _GEO_BYPASS = True
+
+ __LANG_MAP = { | yt_dlp/extractor/arte.py | 26 | Python | 0.214 | suggestion | 49 | 51 | 51 | false | [arte] Move to v2 API | 3,302 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
r'VO(?:(?!{0}).+?)?-STM{0}$'.format(l),
# original version in different language, without subtitles
r'VO(?:(?!{0}))?$'.format(l),
# original version in different language, with partial subtitles in different language
r'VO(?:(?!{0}).+?)?-ST(... | All these `[]` should be non-fatal, right? Use `traverse_obj` to achieve that. Also use the same to remove `.get(...).get(...)` below. Most `try_get` could also be replaced with the same | formats, subtitles = [], {}
for stream in config['data']['attributes']['streams']:
# official player contains code like `e.get("versions")[0].eStat.ml5`
stream_version = stream['versions'][0]
stream_version_code = stream_version['eStat']['ml5']
lang_pref ... | @@ -46,154 +49,150 @@ class ArteTVIE(ArteTVBaseIE):
'only_matching': True,
}]
+ _GEO_BYPASS = True
+
+ __LANG_MAP = {
+ 'fr': 'F',
+ 'de': 'A',
+ 'en': 'E[ANG]',
+ 'es': 'E[ESP]',
+ 'it': 'E[ITA]',
+ 'pl': 'E[POL]',
+ }
+
+ # Reference formerly avail... | yt_dlp/extractor/arte.py | 26 | Python | 0.571 | suggestion | 186 | 51 | 51 | false | [arte] Move to v2 API | 3,302 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
'format_note': format_note,
})
formats.extend(m3u8_formats)
continue
format = {
'format_id': format_id,
'language_preference': lang_pref,
'format_note': format_note,
'... | The `5-i` is asking for mistakes if the list expands
```suggestion
lang_pref = int(''.join('01'[x] for x in (
m.group('vlang') == lc,
bool(m.group('vo')),
m.group('stlang') == lc,
not m.group('st'),
... | })
formats.extend(fmts)
self._merge_subtitles(subs, target=subtitles)
elif stream['protocol'] in ('HTTPS', 'RTMP'):
formats.append({
'format_id': f'{stream["protocol"]}-{stream_version_code}',
'url':... | @@ -46,154 +49,150 @@ class ArteTVIE(ArteTVBaseIE):
'only_matching': True,
}]
+ _GEO_BYPASS = True
+
+ __LANG_MAP = {
+ 'fr': 'F',
+ 'de': 'A',
+ 'en': 'E[ANG]',
+ 'es': 'E[ESP]',
+ 'it': 'E[ITA]',
+ 'pl': 'E[POL]',
+ }
+
+ # Reference formerly avail... | yt_dlp/extractor/arte.py | 26 | Python | 0.786 | suggestion | 372 | 51 | 51 | false | [arte] Move to v2 API | 3,302 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
# original version in different language, with partial subtitles in different language
r'VO(?:(?!{0}).+?)?-ST(?!{0}).+?$'.format(l),
# original version in different language, with subtitles for the deaf and hard-of-hearing in different language
r'VO(?:(?!{... | should be
```suggestion
self.report_warning(
``` | stream_version = stream['versions'][0]
stream_version_code = stream_version['eStat']['ml5']
lang_pref = -1
m = self._VERSION_CODE_RE.match(stream_version_code)
if m:
lang_pref = int(''.join('01'[x] for x in (
m.group('vlang... | @@ -46,154 +49,150 @@ class ArteTVIE(ArteTVBaseIE):
'only_matching': True,
}]
+ _GEO_BYPASS = True
+
+ __LANG_MAP = {
+ 'fr': 'F',
+ 'de': 'A',
+ 'en': 'E[ANG]',
+ 'es': 'E[ESP]',
+ 'it': 'E[ITA]',
+ 'pl': 'E[POL]',
+ }
+
+ # Reference formerly avail... | yt_dlp/extractor/arte.py | 26 | Python | 0.643 | suggestion | 63 | 51 | 51 | false | [arte] Move to v2 API | 3,302 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
}
if media_type == 'rtmp':
format['url'] = f['streamer']
format['play_path'] = 'mp4:' + f['url']
format['ext'] = 'flv'
else:
format['url'] = f['url']
formats.append(format)
# For this extractor, qu... | should be non-fatal. Same for other attributes below (including title) | else:
self.report_warning(f'Skipping stream with unknown protocol {stream["protocol"]}')
# TODO: chapters from stream['segments']?
# The JS also looks for chapters in config['data']['attributes']['chapters'],
# but I am yet to find a video having those
... | @@ -46,154 +49,150 @@ class ArteTVIE(ArteTVBaseIE):
'only_matching': True,
}]
+ _GEO_BYPASS = True
+
+ __LANG_MAP = {
+ 'fr': 'F',
+ 'de': 'A',
+ 'en': 'E[ANG]',
+ 'es': 'E[ESP]',
+ 'it': 'E[ITA]',
+ 'pl': 'E[POL]',
+ }
+
+ # Reference formerly avail... | yt_dlp/extractor/arte.py | 26 | Python | 0.286 | suggestion | 70 | 51 | 51 | false | [arte] Move to v2 API | 3,302 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
r'<(?:iframe|script)[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?arte\.tv/player/v\d+/index\.php\?.*?\bjson_url=.+?)\1',
webpage)]
def _real_extract(self, url):
qs = parse_qs(url)
json_url = qs['json_url'][0]
video_id = ArteTVIE._match_id(json_url)
return ... | might as well replace this with fstrings | 'only_matching': True,
}]
@staticmethod
def _extract_urls(webpage):
return [url for _, url in re.findall(
r'<(?:iframe|script)[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:www\.)?arte\.tv/player/v\d+/index\.php\?.*?\bjson_url=.+?)\1',
webpage)]
def _real_extract(self... | @@ -217,43 +216,39 @@ class ArteTVPlaylistIE(ArteTVBaseIE):
_VALID_URL = r'https?://(?:www\.)?arte\.tv/(?P<lang>%s)/videos/(?P<id>RC-\d{6})' % ArteTVBaseIE._ARTE_LANGUAGES
_TESTS = [{
'url': 'https://www.arte.tv/en/videos/RC-016954/earn-a-living/',
- 'info_dict': {
- 'id': 'RC-01695... | yt_dlp/extractor/arte.py | 26 | Python | 0.143 | suggestion | 40 | 51 | 51 | false | [arte] Move to v2 API | 3,302 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
_TESTS = [{
'url': 'https://www.arte.tv/en/videos/politics-and-society/',
'info_dict': {
'id': 'politics-and-society',
'title': 'Politics and society',
'description': 'Investigative documentary series, geopolitical analysis, and international commentary',
... | ```py
for video in playlist['data']['attributes']['items']:
if not isinstance(video, dict):
continue
video_url = video['config']['url']
if not video_url:
continue
```
can be re-written as
```py
for video in traverse_obj(playli... | 'info_dict': {
'id': 'politics-and-society',
'title': 'Politics and society',
'description': 'Investigative documentary series, geopolitical analysis, and international commentary',
},
'playlist_mincount': 13,
}]
@classmethod
def suitable(cls, url... | @@ -217,43 +216,39 @@ class ArteTVPlaylistIE(ArteTVBaseIE):
_VALID_URL = r'https?://(?:www\.)?arte\.tv/(?P<lang>%s)/videos/(?P<id>RC-\d{6})' % ArteTVBaseIE._ARTE_LANGUAGES
_TESTS = [{
'url': 'https://www.arte.tv/en/videos/RC-016954/earn-a-living/',
- 'info_dict': {
- 'id': 'RC-01695... | yt_dlp/extractor/arte.py | 26 | Python | 0.786 | suggestion | 477 | 38 | 35 | false | [arte] Move to v2 API | 3,302 | yt-dlp/yt-dlp | 132,642 | Python | pukkandan | fstirlitz |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.