Welcome to World of IPTV

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Forum Rules

Our Rules: Read to avoid getting banned!

Advertising

Introduce Yourself to the World with Us!

Resource Database

Find the newest resources around IPTV!

Account upgrade

Upgrade your account to unlock more benefits!

Question Script for record the live

swanlove22

Extended Member
Ext. Member
Joined
Oct 19, 2019
Messages
30
Reaction score
8
Points
19
Location
Germany
hello
i have a ppv channels for example : MLS

i need script for record the match automaticlly and when the channel stop , the record stop and when the new record come the channel record over

so the result :

the football match start when finish the last match still re-play until the new match come and like that

thanks
 
hello
i have a ppv channels for example : MLS

i need script for record the match automaticlly and when the channel stop , the record stop and when the new record come the channel record over

so the result :

the football match start when finish the last match still re-play until the new match come and like that

thanks

Hi,

You can do it by your selft mate using ffmpeg your magic command for this is:

-hls_playlist_type event

Complete command:
 
import os
import time
import subprocess
import schedule

# Configuration
stream_url = "YOUR_STREAM_URL" # Replace with your PPV channel URL
output_file = "match_record.mp4"
ffmpeg_path = "ffmpeg" # Make sure ffmpeg is installed and available in PATH
record_duration = 18000 # Maximum duration to record in seconds (5 hours)

def start_recording():
"""Start recording the live stream."""
print("Starting recording...")
command = [
ffmpeg_path,
"-i", stream_url,
"-c", "copy",
"-t", str(record_duration),
"-y", output_file
]
try:
subprocess.run(command)
except Exception as e:
print(f"Error during recording: {e}")

def check_stream_and_record():
"""Check if the stream is online and start recording."""
print("Checking stream status...")
# Check if the stream is online using ffmpeg
command = [ffmpeg_path, "-i", stream_url, "-t", "5", "-f", "null", "-"]
try:
subprocess.run(command, stderr=subprocess.DEVNULL, stdout=subprocess.DEVNULL)
start_recording()
except subprocess.CalledProcessError:
print("Stream is not available.")

# Schedule the recording check
schedule.every(1).minutes.do(check_stream_and_record)

if __name__ == "__main__":
print("Starting the stream recording scheduler...")
while True:
schedule.run_pending()
time.sleep(1)
 
Channels MatchTime Unblock CDN Offshore Server Contact
100 cnx / 90€ 5Gbps / 180€ 48CPU-256GRAM 10Gbps 569€ Skype live:giefsl
500 cnx / 350€ 10Gbps / 350€ 48CPU-128GRAM 5Gbps / 349€ TG @changcdn
1000 cnx / 500€ 20Gbps / 700€ 40CPU-128GRAM 20Gbps / €980 http://coronaserver.com
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top