projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c40feab
)
[camdemy] Python2 compatibility
author
Yen Chi Hsuan
<yan12125@gmail.com>
Thu, 12 Feb 2015 06:23:25 +0000
(14:23 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Thu, 12 Feb 2015 06:23:25 +0000
(14:23 +0800)
youtube_dl/extractor/camdemy.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/camdemy.py
b/youtube_dl/extractor/camdemy.py
index 0d64b5a16d2893749e80fbd82489e3521cdfbcd2..1bc602c31e8407c4e0931203e92b416cc802d267 100644
(file)
--- a/
youtube_dl/extractor/camdemy.py
+++ b/
youtube_dl/extractor/camdemy.py
@@
-4,7
+4,7
@@
from __future__ import unicode_literals
import re
from .common import InfoExtractor
import re
from .common import InfoExtractor
-from ..compat import
compat_urllib_parse
+from ..compat import
(compat_urllib_parse, compat_urlparse)
from ..utils import parse_iso8601
from ..utils import parse_iso8601
@@
-69,9
+69,9
@@
class CamdemyIE(InfoExtractor):
'http://www.camdemy.com/oembed/?format=json&url=' + url, video_id)
thumb_url = oembed_obj['thumbnail_url']
'http://www.camdemy.com/oembed/?format=json&url=' + url, video_id)
thumb_url = oembed_obj['thumbnail_url']
- video_folder = compat_url
lib_
parse.urljoin(thumb_url, 'video/')
+ video_folder = compat_urlparse.urljoin(thumb_url, 'video/')
fileListXML = self._download_xml(
fileListXML = self._download_xml(
- compat_url
lib_
parse.urljoin(video_folder, 'fileList.xml'),
+ compat_urlparse.urljoin(video_folder, 'fileList.xml'),
video_id, 'Filelist XML')
fileName = fileListXML.find('./video/item/fileName').text
video_id, 'Filelist XML')
fileName = fileListXML.find('./video/item/fileName').text
@@
-87,7
+87,7
@@
class CamdemyIE(InfoExtractor):
return {
'id': video_id,
return {
'id': video_id,
- 'url': compat_url
lib_
parse.urljoin(video_folder, fileName),
+ 'url': compat_urlparse.urljoin(video_folder, fileName),
'title': oembed_obj['title'],
'thumbnail': thumb_url,
'description': self._html_search_meta('description', page),
'title': oembed_obj['title'],
'thumbnail': thumb_url,
'description': self._html_search_meta('description', page),
@@
-131,11
+131,11
@@
class CamdemyFolderIE(InfoExtractor):
folder_id = self._match_id(url)
# Add displayMode=list so that all links are displayed in a single page
folder_id = self._match_id(url)
# Add displayMode=list so that all links are displayed in a single page
- parsed_url = list(compat_url
lib_
parse.urlparse(url))
- query = dict(compat_url
lib_
parse.parse_qsl(parsed_url[4]))
+ parsed_url = list(compat_urlparse.urlparse(url))
+ query = dict(compat_urlparse.parse_qsl(parsed_url[4]))
query.update({'displayMode': 'list'})
parsed_url[4] = compat_urllib_parse.urlencode(query)
query.update({'displayMode': 'list'})
parsed_url[4] = compat_urllib_parse.urlencode(query)
- final_url = compat_url
lib_
parse.urlunparse(parsed_url)
+ final_url = compat_urlparse.urlunparse(parsed_url)
page = self._download_webpage(final_url, folder_id)
matches = re.findall(r"href='(/media/\d+/?)'", page)
page = self._download_webpage(final_url, folder_id)
matches = re.findall(r"href='(/media/\d+/?)'", page)