Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -80,38 +80,42 @@ class IviIE(InfoExtractor): | |||||||||||||||||||||||||||||||||||||
'MP4-SHQ', 'MP4-HD720', 'MP4-HD1080') | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
def _real_extract(self, url): | ||||||||||||||||||||||||||||||||||||||
try: | ||||||||||||||||||||||||||||||||||||||
from Crypto.Cipher import Blowfish | ||||||||||||||||||||||||||||||||||||||
from Crypto.Hash import CMAC | ||||||||||||||||||||||||||||||||||||||
except ImportError: | ||||||||||||||||||||||||||||||||||||||
raise ExtractorError('pycrypto not found. Please install it.', expected=True) | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
video_id = self._match_id(url) | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
timestamp = self._download_json( | ||||||||||||||||||||||||||||||||||||||
self._LIGHT_URL, video_id, | ||||||||||||||||||||||||||||||||||||||
'Downloading timestamp JSON', data=json.dumps({ | ||||||||||||||||||||||||||||||||||||||
'method': 'da.timestamp.get', | ||||||||||||||||||||||||||||||||||||||
'params': [] | ||||||||||||||||||||||||||||||||||||||
}).encode())['result'] | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
data = json.dumps({ | ||||||||||||||||||||||||||||||||||||||
'method': 'da.content.get', | ||||||||||||||||||||||||||||||||||||||
'params': [ | ||||||||||||||||||||||||||||||||||||||
video_id, { | ||||||||||||||||||||||||||||||||||||||
'site': 's353', | ||||||||||||||||||||||||||||||||||||||
'site': 's%d', | ||||||||||||||||||||||||||||||||||||||
'referrer': 'http://www.ivi.ru/watch/%s' % video_id, | ||||||||||||||||||||||||||||||||||||||
'contentid': video_id | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
] | ||||||||||||||||||||||||||||||||||||||
}).encode() | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
video_json = self._download_json( | ||||||||||||||||||||||||||||||||||||||
self._LIGHT_URL, video_id, | ||||||||||||||||||||||||||||||||||||||
'Downloading video JSON', data=data, query={ | ||||||||||||||||||||||||||||||||||||||
try: | ||||||||||||||||||||||||||||||||||||||
from Crypto.Cipher import Blowfish | ||||||||||||||||||||||||||||||||||||||
from Crypto.Hash import CMAC | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
timestamp = self._download_json( | ||||||||||||||||||||||||||||||||||||||
self._LIGHT_URL, video_id, | ||||||||||||||||||||||||||||||||||||||
'Downloading timestamp JSON', data=json.dumps({ | ||||||||||||||||||||||||||||||||||||||
'method': 'da.timestamp.get', | ||||||||||||||||||||||||||||||||||||||
'params': [] | ||||||||||||||||||||||||||||||||||||||
}).encode())['result'] | ||||||||||||||||||||||||||||||||||||||
This comment has been minimized.
Sorry, something went wrong. |
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
data = data % 353 | ||||||||||||||||||||||||||||||||||||||
query = { | ||||||||||||||||||||||||||||||||||||||
'ts': timestamp, | ||||||||||||||||||||||||||||||||||||||
'sign': CMAC.new(self._LIGHT_KEY, timestamp.encode() + data, Blowfish).hexdigest(), | ||||||||||||||||||||||||||||||||||||||
This comment has been minimized.
Sorry, something went wrong.
dstftw
Collaborator
|
Distribution | PyCrypto | PyCryptodome | PyCryptodomeX |
---|---|---|---|
Ubuntu | x | x | |
Debian | x | x | |
Fedora | x | x | |
ArchLinux | x | x | |
OpenSuse | x | x | |
Mageia | x | x | x |
CentOS | x | x | x |
Gentoo | x | x |
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
dstftw
Nov 19, 2019
Collaborator
I don't think having pycryptodomex
along with pycrypto
will increase Windows binary much. As ivi is the only place that needs this functionality then for now my vote goes to using pycrypto
and pycryptodomex
side by side.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
dstftw
Nov 21, 2019
Collaborator
It does not look to be possible to bundle pycryptodome(x)
with py2exe producing working exe: Legrandin/pycryptodome#228
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
remitamine
Nov 15, 2019
Author
Collaborator
i will change the condition to check for недоступен для просмотра на площадке s183
presense in error message.
This comment has been minimized.
This comment has been minimized.
Sorry, something went wrong.
Also if this fails extraction will fail though it may have tried s183. So it's more likely that is should try all applicable methods in a row.