PW Akshay

Generation

generate functionTue, 17 Jan 2023

create a python program to stream video from m3u8 url using moviepy module you can also modify this code to do so: from moviepy.editor import VideoFileClip # Replace with the actual M3U8 URL url = "https://xxxxxxx.m3u8" # Open the video file clip = VideoFileClip(url) # Set the codecs and other options clip = clip.set_fps(30).set_audio_fps(44100).set_audio_bitrate(128) # Write the video to file clip.write_videofile("output.flv", codec='libx264', audio_codec='aac')

import requests from bs4 import BeautifulSoup import re import os #url = 'https://www.imdb.com/title/tt7286456/episodes' url = 'https://www1.gogoanime.io/category/slam-dunk' response = requests.get(url) soup = BeautifulSoup(response.text, "html.parser") # print(soup.prettify()) episodes_links = [] episode_name = [] for link in soup.findAll('a'): if '/watch' in link.get('href'): episodes_links.append(link.get('href')) episode_name.append(link.get('title')) # print(episodes_links) # print(episode_name) # The episodes_links contains all the episodes links. # Let's say we want to see the first episode. for i in range(len(episodes_links)): # html = requests.get("http://www1.gogoan

Questions about programming?Chat with your personal AI assistant