Skip to content

Commit

Permalink
Fix error 401 and invalid character
Browse files Browse the repository at this point in the history
  • Loading branch information
Lovi-0 committed May 16, 2024
1 parent d49e1a6 commit f98fbe1
Show file tree
Hide file tree
Showing 9 changed files with 279 additions and 312 deletions.
16 changes: 5 additions & 11 deletions Src/Api/Class/Video.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def collect_info_seasons(self) -> None:

# Make a request to collect information about seasons
response = requests.get(f"https://{self.base_name}.{self.domain}/titles/{self.media_id}-{self.series_name}", headers=self.headers)
response.raise_for_status() # Raise exception for non-200 status codes
response.raise_for_status()

if response.ok:

Expand Down Expand Up @@ -152,7 +152,7 @@ def get_iframe(self, episode_id: str = None) -> None:

# Make a request to get iframe source
response = requests.get(f"https://{self.base_name}.{self.domain}/iframe/{self.media_id}", params=params)
response.raise_for_status() # Raise exception for non-200 status codes
response.raise_for_status()

if response.ok:

Expand Down Expand Up @@ -228,9 +228,9 @@ def get_playlist(self) -> str:
query = urlencode(list(self.window_parameter.data.items()))
base_url = f'https://vixcloud.co/playlist/{self.window_video.id}'

full_url = urljoin(base_url, '?' + query)
#full_url = urljoin(base_url, '?' + query)

return full_url
return base_url

except AttributeError as e:
logging.error(f"Error getting playlist: {e}")
Expand All @@ -245,15 +245,9 @@ def get_key(self) -> str:
"""
try:

# Fix title for latin-1
title = quote(self.window_video.name)

# Set referer header for the request
self.headers['referer'] = f'https://vixcloud.co/embed/{self.window_video.id}?token={self.window_parameter.token}&title={title}&referer=1&expires={self.window_parameter.expires}&canPlayFHD=1'

# Make a request to get key content
response = requests.get('https://vixcloud.co/storage/enc.key', headers=self.headers)
response.raise_for_status() # Raise exception for non-200 status codes
response.raise_for_status()

if response.ok:

Expand Down
6 changes: 6 additions & 0 deletions Src/Api/film.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# 3.12.23 -> 10.12.23

import os
import sys
import logging


# Internal utilities
from Src.Util.console import console
from Src.Util.config import config_manager
from Src.Lib.FFmpeg.my_m3u8 import Downloader
from Src.Util.file_validation import can_create_file
from Src.Util.message import start_message
from .Class import VideoSource

Expand Down Expand Up @@ -49,6 +51,10 @@ def download_film(id_film: str, title_name: str, domain: str):
mp4_name = title_name.replace("-", "_")
mp4_format = mp4_name + ".mp4"

if not can_create_file(mp4_format):
logging.error("Invalid mp4 name.")
sys.exit(0)

# Download the film using the m3u8 playlist, key, and output filename
obj_download = Downloader(
m3u8_playlist = video_source.get_playlist(),
Expand Down
5 changes: 5 additions & 0 deletions Src/Api/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from Src.Util.message import start_message
from Src.Util.os import remove_special_characters
from Src.Lib.Unidecode import transliterate
from Src.Util.file_validation import can_create_file
from Src.Lib.FFmpeg.my_m3u8 import Downloader
from Src.Util.mapper import map_episode_title
from .Class import VideoSource
Expand Down Expand Up @@ -120,6 +121,10 @@ def donwload_video(tv_name: str, index_season_selected: int, index_episode_selec
mp4_path = remove_special_characters(os.path.join(ROOT_PATH, SERIES_FOLDER, tv_name, f"S{index_season_selected}"))
os.makedirs(mp4_path, exist_ok=True)

if not can_create_file(mp4_name):
logging.error("Invalid mp4 name.")
sys.exit(0)

# Get iframe and content for the episode
video_source.get_iframe(episode_id)
video_source.get_content()
Expand Down
Binary file removed Src/Assets/win_7_install/explorer11.png
Binary file not shown.
Binary file removed Src/Assets/win_7_install/internet_option.png
Binary file not shown.
173 changes: 133 additions & 40 deletions Src/Lib/Unidecode/x000.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,132 @@
data = (
# Code points u+007f and below are equivalent to ASCII and are handled by a
# special case in the code. Hence they are not present in this table.
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',

'\x00', # 0x00
'\x01', # 0x01
'\x02', # 0x02
'\x03', # 0x03
'\x04', # 0x04
'\x05', # 0x05
'\x06', # 0x06
'\x07', # 0x07
'\x08', # 0x08
'\x09', # 0x09
'\x0a', # 0x0a
'\x0b', # 0x0b
'\x0c', # 0x0c
'\x0d', # 0x0d
'\x0e', # 0x0e
'\x0f', # 0x0f
'\x10', # 0x10
'\x11', # 0x11
'\x12', # 0x12
'\x13', # 0x13
'\x14', # 0x14
'\x15', # 0x15
'\x16', # 0x16
'\x17', # 0x17
'\x18', # 0x18
'\x19', # 0x19
'\x1a', # 0x1a
'\x1b', # 0x1b
'\x1c', # 0x1c
'\x1d', # 0x1d
'\x1e', # 0x1e
'\x1f', # 0x1f
' ', # 0x20
'!', # 0x21
'"', # 0x22
'#', # 0x23
'$', # 0x24
'%', # 0x25
'&', # 0x26
'\'', # 0x27
'(', # 0x28
')', # 0x29
'*', # 0x2a
'+', # 0x2b
',', # 0x2c
'-', # 0x2d
'.', # 0x2e
'/', # 0x2f
'0', # 0x30
'1', # 0x31
'2', # 0x32
'3', # 0x33
'4', # 0x34
'5', # 0x35
'6', # 0x36
'7', # 0x37
'8', # 0x38
'9', # 0x39
':', # 0x3a
';', # 0x3b
'<', # 0x3c
'=', # 0x3d
'>', # 0x3e
'?', # 0x3f
'@', # 0x40
'A', # 0x41
'B', # 0x42
'C', # 0x43
'D', # 0x44
'E', # 0x45
'F', # 0x46
'G', # 0x47
'H', # 0x48
'I', # 0x49
'J', # 0x4a
'K', # 0x4b
'L', # 0x4c
'M', # 0x4d
'N', # 0x4e
'O', # 0x4f
'P', # 0x50
'Q', # 0x51
'R', # 0x52
'S', # 0x53
'T', # 0x54
'U', # 0x55
'V', # 0x56
'W', # 0x57
'X', # 0x58
'Y', # 0x59
'Z', # 0x5a
']', # 0x5b
'\\', # 0x5c
']', # 0x5d
'^', # 0x5e
'_', # 0x5f
'`', # 0x60
'a', # 0x61
'b', # 0x62
'c', # 0x63
'd', # 0x64
'e', # 0x65
'f', # 0x66
'g', # 0x67
'h', # 0x68
'i', # 0x69
'j', # 0x6a
'k', # 0x6b
'l', # 0x6c
'm', # 0x6d
'n', # 0x6e
'o', # 0x6f
'p', # 0x70
'q', # 0x71
'r', # 0x72
's', # 0x73
't', # 0x74
'u', # 0x75
'v', # 0x76
'w', # 0x77
'x', # 0x78
'y', # 0x79
'z', # 0x7a
'{', # 0x7b
'|', # 0x7c
'}', # 0x7d
'~', # 0x7e
'', # 0x7f
'', # 0x80
'', # 0x81
'', # 0x82
Expand Down Expand Up @@ -45,10 +162,7 @@
' ', # 0xa0
'!', # 0xa1
'C/', # 0xa2

# Not "GBP" - Pound Sign is used for more than just British Pounds.
'PS', # 0xa3

'$?', # 0xa4
'Y=', # 0xa5
'|', # 0xa6
Expand All @@ -63,11 +177,8 @@
'-', # 0xaf
'deg', # 0xb0
'+-', # 0xb1

# These might be combined with other superscript digits (u+2070 - u+2079)
'2', # 0xb2
'3', # 0xb3

'\'', # 0xb4
'u', # 0xb5
'P', # 0xb6
Expand All @@ -76,18 +187,15 @@
'1', # 0xb9
'o', # 0xba
'>>', # 0xbb
' 1/4', # 0xbc
' 1/2', # 0xbd
' 3/4', # 0xbe
'1/4', # 0xbc
'1/2', # 0xbd
'3/4', # 0xbe
'?', # 0xbf
'A', # 0xc0
'A', # 0xc1
'A', # 0xc2
'A', # 0xc3

# Not "AE" - used in languages other than German
'A', # 0xc4

'A', # 0xc5
'AE', # 0xc6
'C', # 0xc7
Expand All @@ -105,30 +213,21 @@
'O', # 0xd3
'O', # 0xd4
'O', # 0xd5

# Not "OE" - used in languages other than German
'O', # 0xd6

'x', # 0xd7
'O', # 0xd8
'U', # 0xd9
'U', # 0xda
'U', # 0xdb

# Not "UE" - used in languages other than German
'U', # 0xdc

'Y', # 0xdd
'U', # 0xdd
'Th', # 0xde
'ss', # 0xdf
'a', # 0xe0
'a', # 0xe1
'a', # 0xe2
'a', # 0xe3

# Not "ae" - used in languages other than German
'a', # 0xe4

'a', # 0xe5
'ae', # 0xe6
'c', # 0xe7
Expand All @@ -146,20 +245,14 @@
'o', # 0xf3
'o', # 0xf4
'o', # 0xf5

# Not "oe" - used in languages other than German
'o', # 0xf6

'/', # 0xf7
'o', # 0xf8
'u', # 0xf9
'u', # 0xfa
'u', # 0xfb

# Not "ue" - used in languages other than German
'u', # 0xfc

'y', # 0xfd
'th', # 0xfe
'y', # 0xff
)
)
Loading

0 comments on commit f98fbe1

Please sign in to comment.