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
62914380
Commit
62914380
authored
Jan 05, 2015
by
Philipp Hagemeister
Browse files
[auengine] Simplify (#4643)
parent
18c3c153
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
+11
-11
youtube_dl/extractor/auengine.py
youtube_dl/extractor/auengine.py
+11
-11
No files found.
youtube_dl/extractor/auengine.py
View file @
62914380
...
...
@@ -7,6 +7,7 @@ from ..compat import compat_urllib_parse
from
..utils
import
(
determine_ext
,
ExtractorError
,
remove_end
,
)
...
...
@@ -27,18 +28,18 @@ class AUEngineIE(InfoExtractor):
video_id
=
self
.
_match_id
(
url
)
webpage
=
self
.
_download_webpage
(
url
,
video_id
)
title
=
self
.
_html_search_regex
(
r
'<title>(?P<title>.+?)</title>'
,
webpage
,
'title'
)
title
=
title
.
strip
(
)
video_url
=
re
.
findall
(
r
'http://\w+.auengine.com/vod/.*[^\W]'
,
webpage
)
video_url
=
map
(
compat_urllib_parse
.
unquote
,
video_url
)
[
0
]
thumbnail
=
re
.
findall
(
r
'http://\w+.auengine.com/thumb/.*[^\W]'
,
webpage
)
thumbnail
=
map
(
compat_urllib_parse
.
unquote
,
thumbnail
)
[
0
]
if
video_url
==
""
and
thumbnail
==
""
:
title
=
self
.
_html_search_regex
(
r
'<title>\s*(?P<title>.+?)\s*</title>'
,
webpage
,
'title'
)
video_url
s
=
re
.
findall
(
r
'http://\w+.auengine.com/vod/.*[^\W]'
,
webpage
)
video_url
=
compat_urllib_parse
.
unquote
(
video_url
s
[
0
]
)
thumbnail
s
=
re
.
findall
(
r
'http://\w+.auengine.com/thumb/.*[^\W]'
,
webpage
)
thumbnail
=
compat_urllib_parse
.
unquote
(
thumbnail
s
[
0
]
)
if
not
video_url
:
raise
ExtractorError
(
'Could not find video URL'
)
ext
=
'.'
+
determine_ext
(
video_url
)
if
ext
==
title
[
-
len
(
ext
):]:
title
=
title
[:
-
len
(
ext
)]
title
=
remove_end
(
title
,
ext
)
return
{
'id'
:
video_id
,
...
...
@@ -47,4 +48,3 @@ class AUEngineIE(InfoExtractor):
'thumbnail'
:
thumbnail
,
'http_referer'
:
'http://www.auengine.com/flowplayer/flowplayer.commercial-3.2.14.swf'
,
}
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