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
09747ba7
Unverified
Commit
09747ba7
authored
Aug 19, 2017
by
Yen Chi Hsuan
Browse files
[liveleak] Support another liveleak embedding pattern (closes #13336)
parent
f8f18f33
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
55 additions
and
11 deletions
+55
-11
ChangeLog
ChangeLog
+3
-0
youtube_dl/extractor/extractors.py
youtube_dl/extractor/extractors.py
+4
-1
youtube_dl/extractor/generic.py
youtube_dl/extractor/generic.py
+18
-5
youtube_dl/extractor/liveleak.py
youtube_dl/extractor/liveleak.py
+30
-5
No files found.
ChangeLog
View file @
09747ba7
...
...
@@ -4,6 +4,9 @@ Core
* [cda] Fix extraction (closes #13935)
* [utils] Fix unescapeHTML for misformed string like "&a"" (#13935)
Extractors
+ [liveleak] Support another liveleak embedding pattern (#13336)
version 2017.08.18
...
...
youtube_dl/extractor/extractors.py
View file @
09747ba7
...
...
@@ -537,7 +537,10 @@ from .limelight import (
LimelightChannelListIE
,
)
from
.litv
import
LiTVIE
from
.liveleak
import
LiveLeakIE
from
.liveleak
import
(
LiveLeakIE
,
LiveLeakEmbedIE
,
)
from
.livestream
import
(
LivestreamIE
,
LivestreamOriginalIE
,
...
...
youtube_dl/extractor/generic.py
View file @
09747ba7
...
...
@@ -1519,14 +1519,27 @@ class GenericIE(InfoExtractor):
# LiveLeak embed
{
'url'
:
'http://www.wykop.pl/link/3088787/'
,
'md5'
:
'
ace83b9ed19b21f68e1b50e844fdf95d
'
,
'md5'
:
'
7619da8c820e835bef21a1efa2a0fc71
'
,
'info_dict'
:
{
'id'
:
'874_1459135191'
,
'ext'
:
'mp4'
,
'title'
:
'Man shows poor quality of new apartment building'
,
'description'
:
'The wall is like a sand pile.'
,
'uploader'
:
'Lake8737'
,
}
},
'add_ie'
:
[
LiveLeakIE
.
ie_key
()],
},
# Another LiveLeak embed pattern (#13336)
{
'url'
:
'https://milo.yiannopoulos.net/2017/06/concealed-carry-robbery/'
,
'info_dict'
:
{
'id'
:
'2eb_1496309988'
,
'ext'
:
'mp4'
,
'title'
:
'Thief robs place where everyone was armed'
,
'description'
:
'md5:694d73ee79e535953cf2488562288eee'
,
'uploader'
:
'brazilwtf'
,
},
'add_ie'
:
[
LiveLeakIE
.
ie_key
()],
},
# Duplicated embedded video URLs
{
...
...
@@ -2757,9 +2770,9 @@ class GenericIE(InfoExtractor):
self
.
_proto_relative_url
(
instagram_embed_url
),
InstagramIE
.
ie_key
())
# Look for LiveLeak embeds
liveleak_url
=
LiveLeakIE
.
_extract_url
(
webpage
)
if
liveleak_url
:
return
self
.
url_result
(
liveleak_url
,
'LiveLeak'
)
liveleak_url
s
=
LiveLeakIE
.
_extract_url
s
(
webpage
)
if
liveleak_url
s
:
return
self
.
playlist_from_matches
(
liveleak_url
s
,
video_id
,
video_title
)
# Look for 3Q SDN embeds
threeqsdn_url
=
ThreeQSDNIE
.
_extract_url
(
webpage
)
...
...
youtube_dl/extractor/liveleak.py
View file @
09747ba7
...
...
@@ -75,12 +75,10 @@ class LiveLeakIE(InfoExtractor):
}]
@
staticmethod
def
_extract_url
(
webpage
):
mobj
=
re
.
search
(
r
'<iframe[^>]+src="https?://(?:\w+\.)?liveleak\.com/ll_embed\?
(?:.*?)i=(?P<id>[\w_]+)(?:.*)
'
,
def
_extract_url
s
(
webpage
):
return
re
.
findall
(
r
'<iframe[^>]+src="
(
https?://(?:\w+\.)?liveleak\.com/ll_embed\?
[^"]*[if]=[\w_]+[^"]+)"
'
,
webpage
)
if
mobj
:
return
'http://www.liveleak.com/view?i=%s'
%
mobj
.
group
(
'id'
)
def
_real_extract
(
self
,
url
):
video_id
=
self
.
_match_id
(
url
)
...
...
@@ -131,3 +129,30 @@ class LiveLeakIE(InfoExtractor):
})
return
info_dict
class
LiveLeakEmbedIE
(
InfoExtractor
):
_VALID_URL
=
r
'https?://(?:www\.)?liveleak\.com/ll_embed\?.*?\b(?P<kind>[if])=(?P<id>[\w_]+)'
# See generic.py for actual test cases
_TESTS
=
[{
'url'
:
'https://www.liveleak.com/ll_embed?i=874_1459135191'
,
'only_matching'
:
True
,
},
{
'url'
:
'https://www.liveleak.com/ll_embed?f=ab065df993c1'
,
'only_matching'
:
True
,
}]
def
_real_extract
(
self
,
url
):
mobj
=
re
.
match
(
self
.
_VALID_URL
,
url
)
kind
,
video_id
=
mobj
.
group
(
'kind'
,
'id'
)
if
kind
==
'f'
:
webpage
=
self
.
_download_webpage
(
url
,
video_id
)
liveleak_url
=
self
.
_search_regex
(
r
'logourl\s*:\s*(?P<q1>[\'"])(?P<url>%s)(?P=q1)'
%
LiveLeakIE
.
_VALID_URL
,
webpage
,
'LiveLeak URL'
,
group
=
'url'
)
elif
kind
==
'i'
:
liveleak_url
=
'http://www.liveleak.com/view?i=%s'
%
video_id
return
self
.
url_result
(
liveleak_url
,
ie
=
LiveLeakIE
.
ie_key
())
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