Digital Eliteboard - Das Digitale Technik Forum

Registriere dich noch heute kostenloses um Mitglied zu werden! Sobald du angemeldet bist, kannst du auf unserer Seite aktiv teilnehmen, indem du deine eigenen Themen und Beiträge erstellst und dich über deinen eigenen Posteingang mit anderen Mitgliedern unterhalten kannst! Zudem bekommst du Zutritt zu Bereiche, welche für Gäste verwehrt bleiben

Xtream Codes 1.x / 2.x Extend API Functionality - Create & Restart Streams on 2x - Player API on 1.6x

gtaman92

Newbie
Registriert
20. September 2019
Beiträge
5
Reaktionspunkte
11
Punkte
3
Hi all,
Due to Xtream Codes going down, I'd imagine a lot of people wanting to migrate to the cracked Xtream Codes 1.6 panel. Doing this will remove the player_api.php functionality as it was not implemented until 2.x, so I've written a quick and dirty wrapper to replicate the functionality. It's a start, with more to be implemented later. Currently the WHMCS Web TV Player works as well as the GSE IPTV android app. Many more android apps want to work too, but some reason why I'm trying to figure that out.

In addition to this, if people decide to stay on 2x, I've written a quick wrapper to allow continuation of service during the Xtream Codes downtime by giving panel admins the ability to restart their broken streams with new sources, or create new streams and run them. You still have to have some database knowledge as it requires going into the database and amending the `stream_source`, or creating a new stream in the `streams` table. The PHP files' only purpose at the moment is to force Xtream Codes to analyse the new source, and restart the stream accordingly. Or start the new stream if it can't find it in the database.

I've tested it with my panel that I installed today, as it turns out the license server is completely down so it's possible to install it without a license check. I then added users manually, as well as bouquet's etc, then added a stream and played around with the database until I got XC to start the stream finally. Then I wrote this wrapper to automate that part of the process.

From here I'm going to write an admin panel that will list all current streams, bouquets etc, and allow editing from a user interface. Thought I'd throw this out here now though so people can continue service until the admin interface is complete or someone else brings something to the table.

XTREAM CODES 2.x

Current Functionality

  • Restart existing stream.
  • Start new stream.
How to Use
  • Place the php file here: /home/xtreamcodes/iptv_xtream_codes/wwwdir/includes/restart_stream.php
  • Edit the MySQL connection details and authorisation password in the php file. Save it.
  • Run the script: http://IPADDRESS:pORT/includes/restart_stream.php?auth=PASSWORD&id=STREAM_ID
Create a Stream
  • Enter the MySQL database.
  • Create a new stream under the streams table.
  • Add the stream_id to the relevant bouquet in the bouquets table.
  • Run the script to analyse the stream and start it.
Change a Stream Source
  • Enter the MySQL database.
  • Find your stream in the streams table.
  • Edit the stream_source column with your new sources. List format, URL encoded. E.g. ["
    Du musst dich Anmelden oder Registrieren um diesen link zusehen!
    "]
  • Run the script to analyse the stream and restart it with the new sources.
Restart a Stream
  • Run the script to restart a stream. No changes to the database required.
Future Plans
  • Full Admin UI interface. Either written from scratch or ported from Xtream Codes 1.6x.
  • Full stream control (create, restart, stop, delete, ban, unban).
  • Full user control, bouquet management, mag users, enigma, timeshift, settings etc.

URL:
Du musst dich Anmelden oder Registrieren um diesen link zusehen!




XTREAM CODES 1.6x

Replacing panel_api.php is optional, it's just slightly different in 2.0x. Nginx config replacement is necessary to allow CORS on web player.

FEATURES
  • Decoded Xtream Codes 2x API backported to 1.6x
  • Live TV, EPG and VOD functionality reimplemented
  • CORS implementation in NGINX
LIMITATIONS
  • No TV Series support in 1.6x
  • No catchup support in 1.6x
FUTURE PLANS
  • Implement TV Series support manually
INSTALLATION
  • Just extract the files to / home / xtreamcodes / iptv_xtream_codes and overwrite. Backup your old files!


Files available at:
Du musst dich Anmelden oder Registrieren um diesen link zusehen!
 
Zuletzt bearbeitet:
Was unable to create a new topic in this forum so I've amended the thread with a 2.x script that allows people to fix their dead streams and create new ones. It seems people haven't figured out how to do so yet.
 
Haha it's open source, I've escaped all the strings so there's no possibility of MySQL injection so there shouldn't be anything to worry about. I recognise your name by the way... Ice IPTV?

Just tested it on Premier Sports 1:

Stream restarted. New PID: 25916

Array ( [codecs] => Array ( [video] => Array ( [index] => 0 [codec_name] => h264 [codec_long_name] => H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [profile] => High [codec_type] => video [codec_time_base] => 1/50 [codec_tag_string] => [27][0][0][0] [codec_tag] => 0x001b [width] => 1920 [height] => 1080 [coded_width] => 1920 [coded_height] => 1088 [has_b_frames] => 0 [sample_aspect_ratio] => 1:1 [display_aspect_ratio] => 16:9 [pix_fmt] => yuv420p [level] => 40 [chroma_location] => left [field_order] => progressive [refs] => 1 [is_avc] => false [nal_length_size] => 0 [id] => 0xd3 [r_frame_rate] => 25/1 [avg_frame_rate] => 25/1 [time_base] => 1/90000 [start_pts] => 8325252482 [start_time] => 92502.805356 [bits_per_raw_sample] => 8 [disposition] => Array ( [default] => 0 [dub] => 0 [original] => 0 [comment] => 0 [lyrics] => 0 [karaoke] => 0 [forced] => 0 [hearing_impaired] => 0 [visual_impaired] => 0 [clean_effects] => 0 [attached_pic] => 0 [timed_thumbnails] => 0 ) ) [audio] => Array ( [index] => 1 [codec_name] => aac [codec_long_name] => AAC (Advanced Audio Coding) [profile] => LC [codec_type] => audio [codec_time_base] => 1/44100 [codec_tag_string] => [15][0][0][0] [codec_tag] => 0x000f [sample_fmt] => fltp [sample_rate] => 44100 [channels] => 2 [channel_layout] => stereo [bits_per_sample] => 0 [id] => 0xdd [r_frame_rate] => 0/0 [avg_frame_rate] => 0/0 [time_base] => 1/90000 [start_pts] => 8325254421 [start_time] => 92502.826900 [bit_rate] => 116796 [disposition] => Array ( [default] => 0 [dub] => 0 [original] => 0 [comment] => 0 [lyrics] => 0 [karaoke] => 0 [forced] => 0 [hearing_impaired] => 0 [visual_impaired] => 0 [clean_effects] => 0 [attached_pic] => 0 [timed_thumbnails] => 0 ) [tags] => Array ( [language] => eng ) ) ) [container] => mpegts [filename] => REMOVED [bitrate] => [of_duration] => N/A [duration] => N/A )
 
yes you right was written befor i chack the script its lock like safe bud the main problem can be thad after full restart all stream thad can be oveflood trafiik if the all channels ondemoand begin to restrated :))
 
It restarts by stream ID so it'll only restart one at a time. It then waits for the stream to be analysed before returning the new process ID and updating the database accordingly. So it can take 30 seconds+ to restart each stream on average.

I will write an admin interface to manage them better but I figured it would be best to get something out quickly and expand on it.

To restart Premier Sports 1, I just did this:
Du musst dich Anmelden oder Registrieren um diesen link zusehen!
 
I'll have an interface ready tomorrow / monday which will allow you to start / stop / restart streams, edit new sources, add channels, delete channels etc. Bouquet management will be available too.

I can replicate the entire admin interface, but we'll need someone to crack the AES encryption on the config file and ssh_password in the streaming_servers table for us to have full control over the system. Without that part, we can't add new streaming servers. 1.6 panel used mc_decrypt function but 2x removed that and replaced it. I'll need to look into what it does now instead.
 
Zuletzt bearbeitet:
waw lets us suprice
thank you for your efort
i think for now will be very good this ...
 
good work for XTREAM CODES 1.6x API is possible finish?
wht need edit in nginx for API 1.6?
 
Zurück
Oben