diff options
author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-11-30 00:03:59 +0100 |
---|---|---|
committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2014-11-30 00:03:59 +0100 |
commit | 42939b6129833e3fb9f4c22e4e9f4056df193af2 (patch) | |
tree | 4816c060fca9180b213025235ae0cc266037ebc4 /youtube_dl/extractor/common.py | |
parent | 37ea8164d38a03c56c454f369abd82e1a74312e3 (diff) |
[youtube] Use a cookie for seeting the language
This way, we don't have to do an aditional request
Diffstat (limited to 'youtube_dl/extractor/common.py')
-rw-r--r-- | youtube_dl/extractor/common.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/extractor/common.py b/youtube_dl/extractor/common.py index 3e84d0e62..e80a2dad0 100644 --- a/youtube_dl/extractor/common.py +++ b/youtube_dl/extractor/common.py @@ -13,6 +13,7 @@ import time import xml.etree.ElementTree from ..compat import ( + compat_cookiejar, compat_http_client, compat_urllib_error, compat_urllib_parse_urlparse, @@ -817,6 +818,11 @@ class InfoExtractor(object): self._downloader.report_warning(msg) return res + def _set_cookie(self, domain, name, value, expire_time=None): + cookie = compat_cookiejar.Cookie(0, name, value, None, None, domain, None, + None, '/', True, False, expire_time, '', None, None, None) + self._downloader.cookiejar.set_cookie(cookie) + class SearchInfoExtractor(InfoExtractor): """ |