projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
acd620c
)
[teamcoco] relax _VALID_URL regex and add a fallback for format extraction(fixes...
author
Remita Amine
<remitamine@gmail.com>
Sat, 19 May 2018 12:05:51 +0000
(13:05 +0100)
committer
Remita Amine
<remitamine@gmail.com>
Sat, 19 May 2018 12:05:51 +0000
(13:05 +0100)
youtube_dl/extractor/teamcoco.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/teamcoco.py
b/youtube_dl/extractor/teamcoco.py
index 64235b0f6c1433212de64aaec97532ba35a2bf24..63fd4fe1c78ef295d8e2447acffddcb1fb400ab6 100644
(file)
--- a/
youtube_dl/extractor/teamcoco.py
+++ b/
youtube_dl/extractor/teamcoco.py
@@
-16,7
+16,7
@@
from ..utils import (
class TeamcocoIE(InfoExtractor):
class TeamcocoIE(InfoExtractor):
- _VALID_URL = r'https?://teamcoco\.com/
video/
(?P<id>([^/]+/)*[^/?#]+)'
+ _VALID_URL = r'https?://teamcoco\.com/(?P<id>([^/]+/)*[^/?#]+)'
_TESTS = [
{
'url': 'http://teamcoco.com/video/mary-kay-remote',
_TESTS = [
{
'url': 'http://teamcoco.com/video/mary-kay-remote',
@@
-70,6
+70,15
@@
class TeamcocoIE(InfoExtractor):
}, {
'url': 'http://teamcoco.com/video/the-conan-audiencey-awards-for-04/25/18',
'only_matching': True,
}, {
'url': 'http://teamcoco.com/video/the-conan-audiencey-awards-for-04/25/18',
'only_matching': True,
+ }, {
+ 'url': 'http://teamcoco.com/italy/conan-jordan-schlansky-hit-the-streets-of-florence',
+ 'only_matching': True,
+ }, {
+ 'url': 'http://teamcoco.com/haiti/conan-s-haitian-history-lesson',
+ 'only_matching': True,
+ }, {
+ 'url': 'http://teamcoco.com/israel/conan-hits-the-streets-beaches-of-tel-aviv',
+ 'only_matching': True,
}
]
}
]
@@
-84,7
+93,7
@@
class TeamcocoIE(InfoExtractor):
display_id = self._match_id(url)
response = self._graphql_call('''{
display_id = self._match_id(url)
response = self._graphql_call('''{
- %s(slug: "
video/
%s") {
+ %s(slug: "%s") {
... on RecordSlug {
record {
id
... on RecordSlug {
record {
id
@@
-94,6
+103,9
@@
class TeamcocoIE(InfoExtractor):
thumb {
preview
}
thumb {
preview
}
+ file {
+ url
+ }
tags {
name
}
tags {
name
}
@@
-111,15
+123,15
@@
class TeamcocoIE(InfoExtractor):
record = response['record']
video_id = record['id']
record = response['record']
video_id = record['id']
-
src
s = self._graphql_call('''{
+
video_source
s = self._graphql_call('''{
%s(id: "%s") {
src
}
%s(id: "%s") {
src
}
-}''', 'RecordVideoSource', video_id)
['src']
+}''', 'RecordVideoSource', video_id)
or {}
formats = []
get_quality = qualities(['low', 'sd', 'hd', 'uhd'])
formats = []
get_quality = qualities(['low', 'sd', 'hd', 'uhd'])
- for format_id, src in
srcs
.items():
+ for format_id, src in
video_sources.get('src', {})
.items():
if not isinstance(src, dict):
continue
src_url = src.get('src')
if not isinstance(src, dict):
continue
src_url = src.get('src')
@@
-146,6
+158,9
@@
class TeamcocoIE(InfoExtractor):
'format_id': format_id,
'quality': get_quality(format_id),
})
'format_id': format_id,
'quality': get_quality(format_id),
})
+ if not formats:
+ formats = self._extract_m3u8_formats(
+ record['file']['url'], video_id, 'mp4', fatal=False)
self._sort_formats(formats)
return {
self._sort_formats(formats)
return {