diff options
author | Remita Amine <remitamine@gmail.com> | 2018-06-13 15:12:42 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2018-06-13 15:12:42 +0100 |
commit | 18d66f04107b584c2d6ee6c175c44c7f2d81ecba (patch) | |
tree | abf5f525ddff8bb46e9c52755f135728dc2e130f /youtube_dl/extractor | |
parent | f15f7a674b309eff00a66d16449f8d5abb1c6682 (diff) |
[dailymotion] use compat_struct_pack
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/dailymotion.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/youtube_dl/extractor/dailymotion.py b/youtube_dl/extractor/dailymotion.py index 0afb6a158..9a74906cb 100644 --- a/youtube_dl/extractor/dailymotion.py +++ b/youtube_dl/extractor/dailymotion.py @@ -8,10 +8,9 @@ import json import random import re import string -import struct from .common import InfoExtractor - +from ..compat import compat_struct_pack from ..utils import ( determine_ext, error_to_compat_str, @@ -177,7 +176,7 @@ class DailymotionIE(DailymotionBaseInfoExtractor): r = int(metadata['id'][1:], 36) us64e = lambda x: base64.urlsafe_b64encode(x).decode().strip('=') t = ''.join(random.choice(string.ascii_letters) for i in range(10)) - n = us64e(struct.pack('I', r)) + n = us64e(compat_struct_pack('I', r)) i = us64e(hashlib.md5(('%s%d%s' % (password, r, t)).encode()).digest()) metadata = self._download_json( 'http://www.dailymotion.com/player/metadata/video/p' + i + t + n, video_id) |