GilbertClaus commited on
Commit
4f1b288
·
1 Parent(s): e07bd3d
Files changed (1) hide show
  1. iwara.py +9 -15
iwara.py CHANGED
@@ -62,8 +62,8 @@ class ApiClient:
62
  print("Name:", name)
63
  print("Username:", username)
64
  print("Title:", title)
65
- judul = f"{name} - {title.replace('’S', '’s').replace(' / ', ' ').replace('/', ' ').replace('_', ' ')}"
66
- folder_download = f"/content/Download Iwara/Thumbnail/{name}"
67
  if not os.path.exists(folder_download):
68
  os.makedirs(folder_download)
69
  thumbnail_file_name = os.path.join(folder_download, judul + '.jpg')
@@ -104,8 +104,8 @@ class ApiClient:
104
  print("Name:", name)
105
  print("Username:", username)
106
  print("Title:", title)
107
- judul = f"{name} - {title.replace('’S', '’s').replace(' / ', ' ').replace('/', ' ').replace('_', ' ')}"
108
- folder_download = f"/content/Download/{name}"
109
  if not os.path.exists(folder_download):
110
  os.makedirs(folder_download)
111
  quality_priority = ['Source', '1080', '720', '540', '480', '360']
@@ -166,20 +166,14 @@ def iwara(video_url, x, y):
166
  if 'client' not in globals():
167
  client = ApiClient(email=x, password=y)
168
  client.login()
169
- # Set the path to the thumbnail directory
170
- directory = "/home/user/app/Iwara"
171
- if not os.path.exists(directory):
172
- os.makedirs(directory)
173
-
174
- judul = judul.replace('_',' ').title().replace('Mmd','MMD').replace('/',' ').replace('Nikke','NIKKE').replace('Fate','FATE').replace('】','】 ').replace(' ', ' ')
175
- thumbnail_url = 'https://saradahentai.com/wp-content/uploads/2023/03/Live-Footage-of-Ashley-Graham-Captured-by-fugtrup-Resident-Evil-4.jpg'
176
-
177
- thumbnail_file = download_file(thumbnail_url, judul, directory)
178
- video_file = download_file(video_url, judul, directory)
179
 
 
 
 
 
180
  # Mengkonversi video
181
  video_file = convert_videos(720, video_file)
182
-
183
 
184
  video_info = f"Judul: {judul}\n"
185
 
 
62
  print("Name:", name)
63
  print("Username:", username)
64
  print("Title:", title)
65
+ judul = f"{name} - {title.replace(' / ', ' ').replace('/', ' ').replace('_', ' ').title().replace('’S', '’s').replace('Mmd','MMD').replace('Nikke','NIKKE').replace('Fate','FATE').replace('】','】 ').replace(' ', ' ')}"
66
+ folder_download = f"/home/user/app/Iwara/Thumbnail/{name}"
67
  if not os.path.exists(folder_download):
68
  os.makedirs(folder_download)
69
  thumbnail_file_name = os.path.join(folder_download, judul + '.jpg')
 
104
  print("Name:", name)
105
  print("Username:", username)
106
  print("Title:", title)
107
+ judul = f"{name} - {title.replace(' / ', ' ').replace('/', ' ').replace('_', ' ').title().replace('’S', '’s').replace('Mmd','MMD').replace('Nikke','NIKKE').replace('Fate','FATE').replace('】','】 ').replace(' ', ' ')}"
108
+ folder_download = f"/home/user/app/Iwara/Video/{name}"
109
  if not os.path.exists(folder_download):
110
  os.makedirs(folder_download)
111
  quality_priority = ['Source', '1080', '720', '540', '480', '360']
 
166
  if 'client' not in globals():
167
  client = ApiClient(email=x, password=y)
168
  client.login()
 
 
 
 
 
 
 
 
 
 
169
 
170
+ video_id = video_url.split("/")[4]
171
+ video_file = client.download_video(video_id)
172
+ thumbnail_file = client.download_video_thumbnail(video_id)
173
+
174
  # Mengkonversi video
175
  video_file = convert_videos(720, video_file)
176
+ judul = os.path.splitext(os.path.basename(video_file))[0]
177
 
178
  video_info = f"Judul: {judul}\n"
179