projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3d83a1a
)
[extractor/common] Add id and title helpers for generic IEs
author
Yen Chi Hsuan
<yan12125@gmail.com>
Fri, 7 Oct 2016 11:20:53 +0000
(19:20 +0800)
committer
Yen Chi Hsuan
<yan12125@gmail.com>
Fri, 7 Oct 2016 11:20:53 +0000
(19:20 +0800)
youtube_dl/extractor/common.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/common.py
b/youtube_dl/extractor/common.py
index 1076b46da773b5c90cf0c898202f9a8fc5279dbf..da192728f182dbe38c754337c83d5766112f123d 100644
(file)
--- a/
youtube_dl/extractor/common.py
+++ b/
youtube_dl/extractor/common.py
@@
-21,6
+21,7
@@
from ..compat import (
compat_os_name,
compat_str,
compat_urllib_error,
compat_os_name,
compat_str,
compat_urllib_error,
+ compat_urllib_parse_unquote,
compat_urllib_parse_urlencode,
compat_urllib_request,
compat_urlparse,
compat_urllib_parse_urlencode,
compat_urllib_request,
compat_urlparse,
@@
-2020,6
+2021,12
@@
class InfoExtractor(object):
headers['Ytdl-request-proxy'] = geo_verification_proxy
return headers
headers['Ytdl-request-proxy'] = geo_verification_proxy
return headers
+ def _generic_id(self, url):
+ return compat_urllib_parse_unquote(os.path.splitext(url.rstrip('/').split('/')[-1])[0])
+
+ def _generic_title(self, url):
+ return compat_urllib_parse_unquote(os.path.splitext(url_basename(url))[0])
+
class SearchInfoExtractor(InfoExtractor):
"""
class SearchInfoExtractor(InfoExtractor):
"""