Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backups
youtube-dl
Commits
381ad4f3
Unverified
Commit
381ad4f3
authored
Aug 19, 2017
by
Yen Chi Hsuan
Browse files
[liveleak] Support multi-video pages (closes #6542)
parent
e2481b9b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
16 deletions
+28
-16
ChangeLog
ChangeLog
+1
-0
youtube_dl/extractor/liveleak.py
youtube_dl/extractor/liveleak.py
+27
-16
No files found.
ChangeLog
View file @
381ad4f3
...
...
@@ -4,6 +4,7 @@ Core
* [utils] Fix unescapeHTML for misformed string like "&a"" (#13935)
Extractors
+ [liveleak] Support multi-video pages (#6542)
+ [liveleak] Support another liveleak embedding pattern (#13336)
* [cda] Fix extraction (#13935)
...
...
youtube_dl/extractor/liveleak.py
View file @
381ad4f3
...
...
@@ -72,6 +72,13 @@ class LiveLeakIE(InfoExtractor):
'params'
:
{
'skip_download'
:
True
,
},
},
{
'url'
:
'https://www.liveleak.com/view?i=677_1439397581'
,
'info_dict'
:
{
'id'
:
'677_1439397581'
,
'title'
:
'Fuel Depot in China Explosion caught on video'
,
},
'playlist_count'
:
3
,
}]
@
staticmethod
...
...
@@ -109,26 +116,30 @@ class LiveLeakIE(InfoExtractor):
'age_limit'
:
age_limit
,
}
info_dict
=
entries
[
0
]
for
idx
,
info_dict
in
enumerate
(
entries
):
for
a_format
in
info_dict
[
'formats'
]:
if
not
a_format
.
get
(
'height'
):
a_format
[
'height'
]
=
int_or_none
(
self
.
_search_regex
(
r
'([0-9]+)p\.mp4'
,
a_format
[
'url'
],
'height label'
,
default
=
None
))
for
a_format
in
info_dict
[
'formats'
]:
if
not
a_format
.
get
(
'height'
):
a_format
[
'height'
]
=
int_or_none
(
self
.
_search_regex
(
r
'([0-9]+)p\.mp4'
,
a_format
[
'url'
],
'height label'
,
default
=
None
))
self
.
_sort_formats
(
info_dict
[
'formats'
])
self
.
_sort_formats
(
info_dict
[
'formats'
])
# Don't append entry ID for one-video pages to keep backward compatibility
if
len
(
entries
)
>
1
:
info_dict
[
'id'
]
=
'%s_%s'
%
(
video_id
,
idx
+
1
)
else
:
info_dict
[
'id'
]
=
video_id
info_dict
.
update
({
'id'
:
video_id
,
'title'
:
video_title
,
'description'
:
video_description
,
'uploader'
:
video_uploader
,
'age_limit'
:
age_limit
,
'thumbnail'
:
video_thumbnail
,
})
info_dict
.
update
({
'title'
:
video_title
,
'description'
:
video_description
,
'uploader'
:
video_uploader
,
'age_limit'
:
age_limit
,
'thumbnail'
:
video_thumbnail
,
})
return
info_dict
return
self
.
playlist_result
(
entries
,
video_id
,
video_title
)
class
LiveLeakEmbedIE
(
InfoExtractor
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment