- _VALID_URL = r'http://(?:www\.)?einthusan\.com/movies/watch.php\?(.*)?id=(?P<id>[0-9]+).*?'
- _TESTS = [
- {
- 'url': 'http://www.einthusan.com/movies/watch.php?id=2447',
- 'md5': 'af244f4458cd667205e513d75da5b8b1',
- 'info_dict': {
- 'id': '2447',
- 'ext': 'mp4',
- 'title': 'Ek Villain',
- 'thumbnail': 're:^https?://.*\.jpg$',
- }
- },
- {
- 'url': 'http://www.einthusan.com/movies/watch.php?id=1671',
- 'md5': 'ef63c7a803e22315880ed182c10d1c5c',
- 'info_dict': {
- 'id': '1671',
- 'ext': 'mp4',
- 'title': 'Soodhu Kavvuum',
- 'thumbnail': 're:^https?://.*\.jpg$',
- }
- },
- ]
+ _VALID_URL = r'https?://(?P<host>einthusan\.(?:tv|com|ca))/movie/watch/(?P<id>[^/?#&]+)'
+ _TESTS = [{
+ 'url': 'https://einthusan.tv/movie/watch/9097/',
+ 'md5': 'ff0f7f2065031b8a2cf13a933731c035',
+ 'info_dict': {
+ 'id': '9097',
+ 'ext': 'mp4',
+ 'title': 'Ae Dil Hai Mushkil',
+ 'description': 'md5:33ef934c82a671a94652a9b4e54d931b',
+ 'thumbnail': r're:^https?://.*\.jpg$',
+ }
+ }, {
+ 'url': 'https://einthusan.tv/movie/watch/51MZ/?lang=hindi',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://einthusan.com/movie/watch/9097/',
+ 'only_matching': True,
+ }, {
+ 'url': 'https://einthusan.ca/movie/watch/4E9n/?lang=hindi',
+ 'only_matching': True,
+ }]
+
+ # reversed from jsoncrypto.prototype.decrypt() in einthusan-PGMovieWatcher.js
+ def _decrypt(self, encrypted_data, video_id):
+ return self._parse_json(compat_b64decode((
+ encrypted_data[:10] + encrypted_data[-1] + encrypted_data[12:-1]
+ )).decode('utf-8'), video_id)