mirror of
https://github.com/l1ving/youtube-dl
synced 2025-03-11 04:47:15 +08:00
add expiration.
This commit is contained in:
parent
52f8c7f977
commit
2090ccef7b
@ -2,7 +2,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
import time
|
||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
from ..compat import compat_urlparse
|
from ..compat import compat_urlparse
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
@ -247,7 +247,7 @@ class TwitterCardIE(TwitterBaseIE):
|
|||||||
'%s/guest/activate.json' % self._API_BASE, video_id,
|
'%s/guest/activate.json' % self._API_BASE, video_id,
|
||||||
'Downloading guest token', data=b'',
|
'Downloading guest token', data=b'',
|
||||||
headers=headers)['guest_token']
|
headers=headers)['guest_token']
|
||||||
self._set_cookie('api.twitter.com', 'gt', guest_token)
|
self._set_cookie('api.twitter.com', 'gt', guest_token, expire_time=time.time() + 3000)
|
||||||
else:
|
else:
|
||||||
guest_token = guest_token_c.value
|
guest_token = guest_token_c.value
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user