Spaces:
Paused
Paused
GilangAlRusliadi commited on
Commit ·
87420ef
1
Parent(s): c106138
Trailer
Browse files- others.py +5 -12
- trailer.py +2 -7
others.py
CHANGED
|
@@ -179,29 +179,22 @@ def get_video_info(url):
|
|
| 179 |
if item['@type'] == 'VideoObject':
|
| 180 |
selected_video_url = item['contentURL']
|
| 181 |
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
def get_digits(series: str, thumbnail_url: str):
|
| 185 |
if series == 'Cospuri':
|
| 186 |
# Extract digits from thumbnail_url
|
| 187 |
match = re.search(r'/0(\d{3})', thumbnail_url)
|
| 188 |
if match:
|
| 189 |
digits = match.group(1)
|
| 190 |
-
|
| 191 |
-
return digits
|
| 192 |
-
else:
|
| 193 |
-
return ''
|
| 194 |
elif series == 'Fellatio Japan':
|
| 195 |
# Extract digits from thumbnail_url
|
| 196 |
match = re.search(r'/(\d+)_', thumbnail_url)
|
| 197 |
if match:
|
| 198 |
digits = match.group(1)
|
| 199 |
print(f"Kode Digit: {digits}")
|
| 200 |
-
return
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
else:
|
| 204 |
-
return ''
|
| 205 |
|
| 206 |
def find_image_file(name, directory):
|
| 207 |
for root, dirs, files in os.walk(directory):
|
|
|
|
| 179 |
if item['@type'] == 'VideoObject':
|
| 180 |
selected_video_url = item['contentURL']
|
| 181 |
|
| 182 |
+
# Mencari Digits
|
|
|
|
|
|
|
| 183 |
if series == 'Cospuri':
|
| 184 |
# Extract digits from thumbnail_url
|
| 185 |
match = re.search(r'/0(\d{3})', thumbnail_url)
|
| 186 |
if match:
|
| 187 |
digits = match.group(1)
|
| 188 |
+
|
|
|
|
|
|
|
|
|
|
| 189 |
elif series == 'Fellatio Japan':
|
| 190 |
# Extract digits from thumbnail_url
|
| 191 |
match = re.search(r'/(\d+)_', thumbnail_url)
|
| 192 |
if match:
|
| 193 |
digits = match.group(1)
|
| 194 |
print(f"Kode Digit: {digits}")
|
| 195 |
+
return
|
| 196 |
+
|
| 197 |
+
return actress, series, digits, selected_video_url, thumbnail_url
|
|
|
|
|
|
|
| 198 |
|
| 199 |
def find_image_file(name, directory):
|
| 200 |
for root, dirs, files in os.walk(directory):
|
trailer.py
CHANGED
|
@@ -13,18 +13,13 @@ def trailer(url):
|
|
| 13 |
video_dir = "/home/user/app/Hasil Download"
|
| 14 |
if not os.path.exists(thumbnail_dir):
|
| 15 |
os.makedirs(thumbnail_dir)
|
| 16 |
-
response = requests.get(url)
|
| 17 |
-
soup = BeautifulSoup(response.text, 'html.parser')
|
| 18 |
|
| 19 |
# Dapatkan variabel artis dan seri
|
| 20 |
-
actress, series,
|
| 21 |
-
|
| 22 |
-
# Dapatkan kode Digit
|
| 23 |
-
digits = get_digits(series, thumbnail_url)
|
| 24 |
|
| 25 |
# Membuat judul video
|
| 26 |
judul = f"{series} {digits} - {actress}"
|
| 27 |
-
thumbnail_file = download_file(
|
| 28 |
video_file = download_file(video_url, judul, video_dir)
|
| 29 |
|
| 30 |
print("==================================================================================")
|
|
|
|
| 13 |
video_dir = "/home/user/app/Hasil Download"
|
| 14 |
if not os.path.exists(thumbnail_dir):
|
| 15 |
os.makedirs(thumbnail_dir)
|
|
|
|
|
|
|
| 16 |
|
| 17 |
# Dapatkan variabel artis dan seri
|
| 18 |
+
actress, series, digits, video_url, thumbnail_url = get_video_info(url)
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
# Membuat judul video
|
| 21 |
judul = f"{series} {digits} - {actress}"
|
| 22 |
+
thumbnail_file = download_file(thumbnail_url, judul, thumbnail_dir)
|
| 23 |
video_file = download_file(video_url, judul, video_dir)
|
| 24 |
|
| 25 |
print("==================================================================================")
|