Spaces:
Paused
Paused
| from bs4 import BeautifulSoup | |
| import requests | |
| import os | |
| from others import * | |
| def trailer(url): | |
| # Set the path to the thumbnail directory | |
| directory = "/home/user/app/Trailer/Thumbnail" | |
| if not os.path.exists(directory): | |
| os.makedirs(directory) | |
| # Dapatkan variabel artis dan seri | |
| actress, series, digits, video_url, thumbnail_url = get_video_info(url) | |
| # Membuat judul video | |
| judul = f"{series} {digits} - {actress}" | |
| thumbnail_file = download_file(thumbnail_url, judul, directory) | |
| video_file = download_file(video_url, judul, directory) | |
| # Mengkonversi video | |
| video_file = convert_videos(720, video_file) | |
| # Menggabungkan video | |
| video_file = join_video(judul, thumbnail_file, video_file) | |
| video_info = f"Series: {series}\n" | |
| video_info += f"Code: {digits}\n" | |
| video_info += f"Actress: {actress}\n" | |
| return video_file, judul, video_info, thumbnail_file |