Jump to content

m3u to strm file maker script (bash)


h0me5k1n

Recommended Posts

h0me5k1n

I created a script to parse http links from an m3u file and create a folder structure with strm files for (selective) movies and tv shows... tested on ubuntu and a QNAP nas... might be of interest to others in this forum!

 

https://github.com/h0me5k1n/iptv-strmmaker

 

This works for the m3u file i use as an input! Results for others may vary!

Edited by h0me5k1n
  • Like 1
Link to comment
Share on other sites

  • 4 months later...
On 5/25/2020 at 11:54 PM, h0me5k1n said:

I created a script to parse http links from an m3u file and create a folder structure with strm files for (selective) movies and tv shows... tested on ubuntu and a QNAP nas... might be of interest to others in this forum!

 

https://github.com/h0me5k1n/iptv-strmmaker

 

This works for the m3u file i use as an input! Results for others may vary!

Thanks for this! I got some ideas from you creating my own script. Check it out on https://github.com/trix7777/m3u8_to_strm if you're interested.

Link to comment
Share on other sites

h0me5k1n
On 25/10/2020 at 00:34, trix77 said:

Thanks for this! I got some ideas from you creating my own script. Check it out on https://github.com/trix7777/m3u8_to_strm if you're interested.

Looks great @trix77! I think you're probably working with a bigger m3u file than me so interesting to see the timings!

I just updated mine in the last few days so that it better purges items that are removed from the playlist. I'm interested to see how you've done this... Will try it out!

Link to comment
Share on other sites

In fact, I have yet to come up with a good purge function. If I let the script rewrite all files during a run I suspect the indexer (Emby/Jellyfin/Kodi) will see it as a new file (but have not really tested it, shame on me :p, I just took that for granted, and as there are 28602 strm files in my setup it takes quite a while to index) so my script do not output anything if there's a file already existing. I've already come across some "bugs" having it that way, and that is if the m3u8 had a faulty path for a movie in it and the creator (ie the iptv-provider) fixes the path, my strm files will not be updated with the corrected path. Also, if there are duplicates (say with another path and better quality) in the m3u8, my script will not overwrite the first one written. I guess there should not be much of a problem writing all output from an m3u8 to an index file during a run and then compare with the filesystem after the run is complete and do purge files not in the index file. Probably the easiest way, but that will not fix the "bugs" I mentioned above.

Link to comment
Share on other sites

h0me5k1n
1 hour ago, trix77 said:

In fact, I have yet to come up with a good purge function. If I let the script rewrite all files during a run I suspect the indexer (Emby/Jellyfin/Kodi) will see it as a new file (but have not really tested it, shame on me :p, I just took that for granted, and as there are 28602 strm files in my setup it takes quite a while to index) so my script do not output anything if there's a file already existing. I've already come across some "bugs" having it that way, and that is if the m3u8 had a faulty path for a movie in it and the creator (ie the iptv-provider) fixes the path, my strm files will not be updated with the corrected path. Also, if there are duplicates (say with another path and better quality) in the m3u8, my script will not overwrite the first one written. I guess there should not be much of a problem writing all output from an m3u8 to an index file during a run and then compare with the filesystem after the run is complete and do purge files not in the index file. Probably the easiest way, but that will not fix the "bugs" I mentioned above.

Mine does a compare and updates the existing strm file if the url has changed...

The recent update writes an index (like you suggest) during a run and it removes any strm files that exist at the end that weren't included in the previous steps.

Check out what I've done and you should be able to easily incorporate these steps

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...