Jump to content

python script to convert m3u file to strm files with emby folder structure (free)


t1m

Recommended Posts

hooray4me
5 hours ago, Anielarias said:

nice thank u very much, does u docker container supports more than 1 m3u at the same time?

yes

  • Like 1
Link to comment
Share on other sites

Anielarias
On 8/16/2023 at 6:45 PM, hooray4me said:

yes

does your plugin supports this type of urls? 

  • http://serverurl:port/get.php?username=xxx&password=xxx&type=m3u_plus
  • http://serverurl:port/get.php?username=xxx&password=xxx&type=m3u_plus&output=mpegts
  • http://serverurl:port/get.php?username=xxx&password=xxx&type=m3u_plus&output=ts
Link to comment
Share on other sites

hooray4me
25 minutes ago, Anielarias said:

does your plugin supports this type of urls? 

  • http://serverurl:port/get.php?username=xxx&password=xxx&type=m3u_plus
  • http://serverurl:port/get.php?username=xxx&password=xxx&type=m3u_plus&output=mpegts
  • http://serverurl:port/get.php?username=xxx&password=xxx&type=m3u_plus&output=ts

ustreamgen can do that using a single list.

- SINGLELIST=true
- SINGLELISTURL=http://serverurl:port/get.php?username=xxx&password=xxx&type=m3u_plus

The quickest way to accomplish what you want would probably be to create several docker containers of ustreamgen and purpose 1 per stream list. The container is pretty light weight.

Edited by hooray4me
Link to comment
Share on other sites

Anielarias
1 hour ago, hooray4me said:

ustreamgen can do that using a single list.

- SINGLELIST=true
- SINGLELISTURL=http://serverurl:port/get.php?username=xxx&password=xxx&type=m3u_plus

The quickest way to accomplish what you want would probably be to create several docker containers of ustreamgen and purpose 1 per stream list. The container is pretty light weight.

is there a way to use the same container for 2 or more urls?

Edited by Anielarias
Link to comment
Share on other sites

hooray4me
9 hours ago, Anielarias said:

is there a way to use the same container for 2 or more urls?

not yet

Link to comment
Share on other sites

Thefalfr
Traceback (most recent call last):
  File "main.py", line 34, in <module>
    listhandler.parseIPTVLists(funct, providerurl, directory, path)
  File "/m3u2strm/listhandler.py", line 9, in parseIPTVLists
    downloadAndParseLists(type, url, endrange)
  File "/m3u2strm/listhandler.py", line 32, in downloadAndParseLists
    downloadAndParseList(url, type)
  File "/m3u2strm/listhandler.py", line 40, in downloadAndParseList
    streamClasses.rawStreamList('m3u/' + filename + '.m3u')
  File "/m3u2strm/streamClasses.py", line 88, in __init__
    self.parseLine()
  File "/m3u2strm/streamClasses.py", line 103, in parseLine
    nextline = self.lines[linenumber + 1]
IndexError: list index out of range
no crontab for root
...Starting Download...
m3u/tvshows.m3u

Any idea that can be wrong? I am using tv show m3u from https://xtream-editor.com/

Link to comment
Share on other sites

hooray4me
4 hours ago, Thefalfr said:
Traceback (most recent call last):
  File "main.py", line 34, in <module>
    listhandler.parseIPTVLists(funct, providerurl, directory, path)
  File "/m3u2strm/listhandler.py", line 9, in parseIPTVLists
    downloadAndParseLists(type, url, endrange)
  File "/m3u2strm/listhandler.py", line 32, in downloadAndParseLists
    downloadAndParseList(url, type)
  File "/m3u2strm/listhandler.py", line 40, in downloadAndParseList
    streamClasses.rawStreamList('m3u/' + filename + '.m3u')
  File "/m3u2strm/streamClasses.py", line 88, in __init__
    self.parseLine()
  File "/m3u2strm/streamClasses.py", line 103, in parseLine
    nextline = self.lines[linenumber + 1]
IndexError: list index out of range
no crontab for root
...Starting Download...
m3u/tvshows.m3u

Any idea that can be wrong? I am using tv show m3u from https://xtream-editor.com/

can you post your docker-compose.yaml ?

Link to comment
Share on other sites

Thefalfr
3 hours ago, hooray4me said:

can you post your docker-compose.yaml ?

version: "3"
services:
  m3u2strm:
    image: hooray4rob/ustreamgen:latest
    container_name: m3u2strm
    command: /root/initialize_cron.sh
    environment:
      - PUID=100
      - PGID=1000
      - SINGLELIST=false #when true a single list of movies, series and events is used. flase for multiple lists
      - MOVIES=true #set to false if movies are not desired
      - TVSHOWS=false #set to false if tv shows are not desired
      - EVENTS=false #et to false is live sporting events are not desired
      - CRONHOUR=22 #0-23 # sets the hour of the day the script will run again for all content in 1 list **ALL must be true
      - CRONMINUTE=12 #0-59 # sets the minute of the day the script will run again for all content 1 list **ALL must be true
      - TVCRONHOUR=2 #0-23 # sets the hour of the day the script will run again for tv shows **TVSHOWS must be true
      - TVCRONMINUTE=10 #0-59 # sets the minute of the day the script will run again for tv shows **TVSHOWS must be true
      - MOVIECRONHOUR=2 #0-23 # sets the hour of the day the script will run again for movies **MOVIES must be true
      - MOVIECRONMINUTE=20 #0-59 # sets the minute of the day the script will run again for movies **MOVIES must be true
      - EVENTCRONHOUR=0 #0-23 # sets the hour of the day the script will run again for events **EVENTS must be true
      - EVENTCRONMINUTE=30 #0-59 # sets the minute of the day the script will run again for events **EVENTS must be true
      - TZ=Europe/Stockholm
      #- SINGLELISTURL=http://myprovider.com # Full M3U Provider URL for all content in one list **SINGLELIST must be true
      - MOVIEURL=https://xtream-editor.com/load/m3u/xxxxx/2 # Full M3U Provider URL for Movies **MOVIES must be true
      #- TVSHOWURL=https://xtream-editor.com/load/m3u/xxxxx/3 # Full M3U Provider URL for TV Shows **TVSHOWS must be true
      #- EVENTURL=https://tvnow.best/api/list/user/pass/m3u8/events/ # Full M3U Provider URL for Events **EVENTS must be true
      - APOLLO=false #Optional change to true if your Provider is Apollo
    volumes:
      - /mnt/disks/external1/media/tv-strm:/tv
      - /mnt/disks/external1/media/movies-strm:/movies
      - /mnt/disks/external1/media/events-strm:/events
      - /mnt/user/appdata/m3u2strm:/logs
      
  m3u2strmtv:
    image: hooray4rob/ustreamgen:latest
    container_name: m3u2strmtv
    command: /root/initialize_cron.sh
    environment:
      - PUID=100
      - PGID=1000
      - SINGLELIST=false #when true a single list of movies, series and events is used. flase for multiple lists
      - MOVIES=false #set to false if movies are not desired
      - TVSHOWS=true #set to false if tv shows are not desired
      - EVENTS=false #et to false is live sporting events are not desired
      - CRONHOUR=22 #0-23 # sets the hour of the day the script will run again for all content in 1 list **ALL must be true
      - CRONMINUTE=12 #0-59 # sets the minute of the day the script will run again for all content 1 list **ALL must be true
      - TVCRONHOUR=2 #0-23 # sets the hour of the day the script will run again for tv shows **TVSHOWS must be true
      - TVCRONMINUTE=10 #0-59 # sets the minute of the day the script will run again for tv shows **TVSHOWS must be true
      - MOVIECRONHOUR=2 #0-23 # sets the hour of the day the script will run again for movies **MOVIES must be true
      - MOVIECRONMINUTE=20 #0-59 # sets the minute of the day the script will run again for movies **MOVIES must be true
      - EVENTCRONHOUR=0 #0-23 # sets the hour of the day the script will run again for events **EVENTS must be true
      - EVENTCRONMINUTE=30 #0-59 # sets the minute of the day the script will run again for events **EVENTS must be true
      - TZ=Europe/Stockholm
      #- SINGLELISTURL=http://myprovider.com # Full M3U Provider URL for all content in one list **SINGLELIST must be true
      #- MOVIEURL=https://xtream-editor.com/load/m3u/xxxxx/2 # Full M3U Provider URL for Movies **MOVIES must be true
      - TVSHOWURL=https://xtream-editor.com/load/m3u/xxxxx/3 # Full M3U Provider URL for TV Shows **TVSHOWS must be true
      #- EVENTURL=https://tvnow.best/api/list/user/pass/m3u8/events/ # Full M3U Provider URL for Events **EVENTS must be true
      - APOLLO=false #Optional change to true if your Provider is Apollo
    volumes:
      - /mnt/disks/external1/media/tv-strm:/tv
      - /mnt/disks/external1/media/movies-strm:/movies
      - /mnt/disks/external1/media/events-strm:/events
      - /mnt/user/appdata/m3u2strmtv:/logs

It looks like this.

Link to comment
Share on other sites

hooray4me

can you post a little of the sanitized content from this?

https://xtream-editor.com/load/m3u/xxxxx/2
Link to comment
Share on other sites

Anielarias
12 minutes ago, hooray4me said:

can you post a little of the sanitized content from this?

https://xtream-editor.com/load/m3u/xxxxx/2

any progress on my request?

Link to comment
Share on other sites

Anielarias
3 minutes ago, hooray4me said:

not yet, I have been busy.

no problem, take your time, do u have a github page so i can follow it or a discord server?

Link to comment
Share on other sites

Thefalfr
21 hours ago, hooray4me said:

can you post a little of the sanitized content from this?

https://xtream-editor.com/load/m3u/xxxxx/2
#EXTM3U url-tvg="https://xtream-editor.com/load/epg/xxxxx"
#EXTINF:-1 tvg-id="" tvg-name="Fury Files S01E01" tvg-logo="" group-title="Series: Barn",Fury Files S01E01
http://xxx.bz:2095/series/xxxx/xxxxx/414989.mkv
#EXTINF:-1 tvg-id="" tvg-name="Fury Files S01E02" tvg-logo="" group-title="Series: Barn",Fury Files S01E02
http://xxx.bz:2095/series/xxxx/xxxxx/414990.mkv
#EXTINF:-1 tvg-id="" tvg-name="Fury Files S01E03" tvg-logo="" group-title="Series: Barn",Fury Files S01E03
http://xxx.bz:2095/series/xxxx/xxxxx/414991.mkv

Movies works fine but not TV-series som this is from https://xtream-editor.com/load/m3u/xxxxx/3

 

All shows has Series: in the begining of group-title. 

Edited by Thefalfr
Link to comment
Share on other sites

hooray4me
On 8/24/2023 at 12:11 PM, Thefalfr said:
#EXTM3U url-tvg="https://xtream-editor.com/load/epg/xxxxx"
#EXTINF:-1 tvg-id="" tvg-name="Fury Files S01E01" tvg-logo="" group-title="Series: Barn",Fury Files S01E01
http://xxx.bz:2095/series/xxxx/xxxxx/414989.mkv
#EXTINF:-1 tvg-id="" tvg-name="Fury Files S01E02" tvg-logo="" group-title="Series: Barn",Fury Files S01E02
http://xxx.bz:2095/series/xxxx/xxxxx/414990.mkv
#EXTINF:-1 tvg-id="" tvg-name="Fury Files S01E03" tvg-logo="" group-title="Series: Barn",Fury Files S01E03
http://xxx.bz:2095/series/xxxx/xxxxx/414991.mkv

Movies works fine but not TV-series som this is from https://xtream-editor.com/load/m3u/xxxxx/3

 

All shows has Series: in the begining of group-title. 

So I think its throwing up because it's missing tvg-type, for my tv shows its tvshows and movies is movies...

#EXTM3U
#EXTINF:-1 tvg-id="tt15527308" tvg-name="tt15527308" tvg-type="tvshows" group-title="Action Pack (2022)" ,Action Pack (2022) S01 E01
https://tvnow.best/api/stream/user/password/tvshow/tt15527308/1/1

 

Link to comment
Share on other sites

hooray4me

Yeah, thats why... its how the script knows what kinds of stream it is...

    typematch = tools.tvgTypeMatch(streaminfo)    
    if typematch:
      streamtype = tools.getResult(typematch)
      if streamtype == 'tvshows':
        return 'vodTV'
      if streamtype == 'movies':
        return 'vodMovie'
      if streamtype == 'live':
        return 'live'
---
def tvgTypeMatch(line):
  typematch = re.compile('tvg-type=\"(.*?)\"', re.IGNORECASE).search(line)
  if typematch:
    return typematch
  return

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...