oh great news. nice to know. and i don't think need to edit the script for some links only. the script still work fine
+ Reply to Thread
Results 31 to 33 of 33
-
-
Code:
import requests from bs4 import BeautifulSoup import re import subprocess import time import json # Importation de la bibliothèque json # Fonction pour récupérer l'URL m3u8 def get_ep(playerid, episodeId=None): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36', 'Referer': 'https://vixcloud.co' } if episodeId: params = {'episode_id': episodeId} response = requests.get(f'https://streamingcommunity.prof/iframe/{playerid}', headers=headers, params=params) else: response = requests.get(f'https://streamingcommunity.prof/iframe/{playerid}', headers=headers) soup = BeautifulSoup(response.text, 'html.parser') iframe_tag = soup.find('iframe', {'ref': 'iframe'}) if iframe_tag: iframe_src = iframe_tag.get('src') response = requests.get(iframe_src, headers=headers) # Récupération des informations nécessaires (URL, token, expires) matches = { 'url': r"url: '([^']+)'", 'token': r"'token': '([^']+)'", 'expires': r"'expires': '([^']+)'" } m = {} for match, regex in matches.items(): mm = re.search(regex, response.text) if mm: m[match] = mm.group(1) else: print(f"{match} not found") if all(key in m for key in ['url', 'token', 'expires']): m3u8_url = f"{m['url']}?token={m['token']}&expires={m['expires']}&h=1" return m3u8_url else: print("Required keys are missing from the iframe response.") return None else: print("No iframe tag found") return None # Fonction pour récupérer les saisons et épisodes def get_season(page_url): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36', 'Referer': 'https://vixcloud.co' } response = requests.get(page_url, headers=headers) soup = BeautifulSoup(response.text, 'html.parser') app_div = soup.find('div', {'id': 'app'}) if app_div and 'data-page' in app_div.attrs: data_page = app_div['data-page'] data_page_json = json.loads(data_page) # Utilisation de json.loads pour convertir en JSON title = data_page_json['props']['title']['name'] playerid = data_page_json['props']['title']['id'] type = data_page_json['props']['title']['type'] if type == 'movie': name_base = sanitize_filename(title) m3u8_url = get_ep(playerid) download_video(m3u8_url, name_base) else: season = data_page_json['props']['loadedSeason'] if season: snumber = season['number'] for episode in season['episodes']: enumber = episode['number'] name = episode['name'] episodeId = episode['id'] m3u8_url = get_ep(playerid, episodeId) name_base = sanitize_filename(f"{title} S{str(snumber).zfill(2)}E{str(enumber).zfill(2)} {name}") download_video(m3u8_url, name_base) else: print("No data-page attribute found in the div with id 'app'") # Fonction pour nettoyer les noms de fichiers def sanitize_filename(name): return re.sub(r'[\\/*?:"<>|]', "", name) # Fonction pour télécharger la vidéo avec N_m3u8DL-RE def download_video(url, output_name_base): output_file = f"{output_name_base}.mp4" command = [ 'N_m3u8DL-RE', url, '--header', 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36', '--header', 'Referer: https://vixcloud.co', '--save-name', output_name_base, '-sv', 'best', '-sa', 'best', '-M' ,'format=mp4', ] try: subprocess.run(command, check=True) print(f"Téléchargement et muxage terminé pour : {output_file}") except FileNotFoundError: print("N_m3u8DL-RE n'est pas installé ou n'est pas dans le PATH.") except subprocess.CalledProcessError as e: print(f"Erreur lors du téléchargement : {e}") # Exemple d'URL à traiter urls = [ "https://streamingcommunity.prof/titles/8424-dark-matter" ] for url in urls: get_season(url)
However, after several downloads, I have a 403 error.... I am trying to resolve it.Last edited by cedric8528; 1st Jan 2025 at 07:41.
-
A quick update: the trick to replace the "?" with "&" before "token" does not work always.
It worked for the test I did, it didn't with another stream.
So don't consider it that much.
Similar Threads
-
Is there is any Script that can do this ?
By Loryanam2 in forum Video Streaming DownloadingReplies: 2Last Post: 8th Apr 2024, 09:19 -
need help with script
By swappyison in forum Video Streaming DownloadingReplies: 0Last Post: 28th Aug 2023, 23:38 -
Script Help
By InfinitiX2 in forum Video Streaming DownloadingReplies: 17Last Post: 29th Jul 2023, 17:02 -
script help
By aletaladro in forum Video Streaming DownloadingReplies: 2Last Post: 19th Jul 2023, 12:13 -
Looking for Batch MP4 Normalization Script of existing script
By VideoFanatic in forum Video ConversionReplies: 6Last Post: 31st Jul 2021, 19:50