Jump to content

m2strm: a console app to create strm-files from m3u8 (free open source) (win/lnx)


Go to solution Solved by trix77,

Recommended Posts

  • Solution
Posted (edited)

Hi all! I've been working on this for quite some time now, first as a bash script, now as a console app written in C#. Please check it out an give feedback! I am atm using Jellyfin and Kodi, so I am not 100 that everything works with Emby.

To run it in Windows, first open a cmd-window with administrator rights and then cd to the directory where you've downloaded the file, then type m2strm.exe /? to get the help content.

To run it in Linux, you need first need to install Mono, in Debian that is: sudo apt-get install mono-devel mono-vbnc

Then run it with mono m2strm.exe

M3U8 is the same as m3u_plus.

Download it from github under Releases here:

https://github.com/trix7777/m2strm

Edited by trix77
  • Like 1
  • Agree 1
  • Thanks 1
  • 2 months later...
Posted


trix77,

Just wanted to say thanks for this tool!

I ran my entire m3u file through it and am adding entries to Emby on an as-want basis.

Took awhile to run, but we're talking about a 36M input file here.

C:\m2strm\Bin>m2strm
2/17/2021 1:21:02 PM: *** Using config set M3U8-file: C:\m2strm\Bin\VOD.m3u
2/17/2021 1:21:02 PM: *** BaseDirectory: C:\m2strm\Bin\
2/17/2021 1:21:02 PM: *** OutDirectory: C:\m2strm\Bin\Output
2/17/2021 1:21:02 PM: *** Movie subfolder: VOD Movies
2/17/2021 1:21:02 PM: *** Series subfolder: VOD Series
2/17/2021 1:21:02 PM: *** TV subfolder: TV Channels
2/17/2021 1:21:02 PM: *** Configuration file in use: C:\m2strm\Bin\m2strm.exe.config
2/17/2021 1:21:02 PM: *** Unwanted groups file in use: C:\m2strm\Bin\uwgroups.cfg
2/17/2021 1:21:02 PM: *** Processing C:\m2strm\Bin\VOD.m3u
2/17/2021 1:37:34 PM: *** Purging files in: C:\m2strm\Bin\Output
2/17/2021 1:37:37 PM: *** Movies summary: 18459 new, 1182 skipped (whereof 1182 dupes), 19641 in total
2/17/2021 1:37:37 PM: *** Episodes summary: 130927 new, 246 skipped (whereof 246 dupes), 131173 in total
2/17/2021 1:37:37 PM: *** TV-channels summary: 0 new
2/17/2021 1:37:37 PM: *** Processing time: 00:16:35.19

C:\m2strm\Bin>

The only suggestion I would make is that you put a "Release" package on github or at the very least, leave an .exe in the Release directory of the project.

This would allow for more people that might not code to use it.

Thanks again,

Mark
 

 

 

VOD Movies.png

  • Agree 1
Posted
21 hours ago, Mark II said:


trix77,

Just wanted to say thanks for this tool!

I ran my entire m3u file through it and am adding entries to Emby on an as-want basis.

Took awhile to run, but we're talking about a 36M input file here.


C:\m2strm\Bin>m2strm
2/17/2021 1:21:02 PM: *** Using config set M3U8-file: C:\m2strm\Bin\VOD.m3u
2/17/2021 1:21:02 PM: *** BaseDirectory: C:\m2strm\Bin\
2/17/2021 1:21:02 PM: *** OutDirectory: C:\m2strm\Bin\Output
2/17/2021 1:21:02 PM: *** Movie subfolder: VOD Movies
2/17/2021 1:21:02 PM: *** Series subfolder: VOD Series
2/17/2021 1:21:02 PM: *** TV subfolder: TV Channels
2/17/2021 1:21:02 PM: *** Configuration file in use: C:\m2strm\Bin\m2strm.exe.config
2/17/2021 1:21:02 PM: *** Unwanted groups file in use: C:\m2strm\Bin\uwgroups.cfg
2/17/2021 1:21:02 PM: *** Processing C:\m2strm\Bin\VOD.m3u
2/17/2021 1:37:34 PM: *** Purging files in: C:\m2strm\Bin\Output
2/17/2021 1:37:37 PM: *** Movies summary: 18459 new, 1182 skipped (whereof 1182 dupes), 19641 in total
2/17/2021 1:37:37 PM: *** Episodes summary: 130927 new, 246 skipped (whereof 246 dupes), 131173 in total
2/17/2021 1:37:37 PM: *** TV-channels summary: 0 new
2/17/2021 1:37:37 PM: *** Processing time: 00:16:35.19

C:\m2strm\Bin>

The only suggestion I would make is that you put a "Release" package on github or at the very least, leave an .exe in the Release directory of the project.

This would allow for more people that might not code to use it.

Thanks again,

Mark
 

 

 

 

Thank you Mark! Yeah, strange thing is that if run in Linux through Mono it's lightning fast even on 30MB+, if it takes like 15 mins in Windows it only takes 20 seconds in Linux. I guess the file management works quite different in the two OS's.

Well, there is a release .exe if you click "Releases" (right column) and then "Assets" 😃

Cheers 😃

Posted

Yes indeed!

image.thumb.png.4ce4776c6a201963cfef6089b8354d1e.png

Hopefully more will give it a go.

 

Regards and thanks.

  • 6 months later...
Posted (edited)

Hi, 

Great tool. But it is skipping files "Dublicates" I have for instance one group that has the name "Movie- Multi Subtitles" and one with the name "Movie- 4K" 
I don't want the tool to skip files in these as of now there is maybe 20 4k files out of 250. and that is because the tool already found them in "Movie- Multi Subtitles" 

I wouldn't mind if I have doublicates as long as they are in different groups so to speak. 

 

Best Regards

Edited by jimbo94
Posted
5 hours ago, jimbo94 said:

Hi, 

Great tool. But it is skipping files "Dublicates" I have for instance one group that has the name "Movie- Multi Subtitles" and one with the name "Movie- 4K" 
I don't want the tool to skip files in these as of now there is maybe 20 4k files out of 250. and that is because the tool already found them in "Movie- Multi Subtitles" 

I wouldn't mind if I have doublicates as long as they are in different groups so to speak. 

 

Best Regards

Hi, glad to see that someone finds it useful! 😃 Regarding your post, I'm sorry to say that I am not interested in adding or removing features to it atm, read about how it works under the section "Notes about dupes". The app strips the 4K from the title in the following code:

            //remove [4K] tag
            fileName = Regex.Replace(fileName, @"\[4K\]", "", RegexOptions.IgnoreCase);

            //remove 4K tag
            fileName = Regex.Replace(fileName, @"4K", "", RegexOptions.IgnoreCase);

Cheers

  • 7 months later...
revengineer
Posted

Thank you for sharing! Compiled easily with VS2022 and works great and better the Xtream-Downloader, which is now defunct.

  • Agree 1
  • 1 month later...
thecubasekid
Posted (edited)

@trix77

 

Signed up just to say thanks for this awesome tool!!

initially i set it up on win 10 and was working great. later on saw about running in mono. i had never heard of mono before.

after much searching and some painful trial and error (kodi suggests mono is installed, but actually it is corrupted and needs everything copying manually oto the initial addon install), i have mono running as an addon inside CoreELEC matrix launching m2strm.exe, fully automated with cron.

Well pleased.

Thank you very much!

Edited by thecubasekid
info
  • Thanks 1
  • 1 year later...
Posted

@trix77wanted to thank you for your work on this one.  I am just now using this and it is working great for me.  Does anyone have any suggestions on how they are doing 24x7 streams?  Series and Movies work well for me....but struggling with 24x7 streams.  Thanks in advance for your time.

  • Thanks 1
Posted
On 9/20/2023 at 7:29 PM, griam01 said:

@trix77wanted to thank you for your work on this one.  I am just now using this and it is working great for me.  Does anyone have any suggestions on how they are doing 24x7 streams?  Series and Movies work well for me....but struggling with 24x7 streams.  Thanks in advance for your time.

Thanks! You are welcome 😃 24/7 streams are just as tv-channels and should be treated as such. Nothing for this script but for say tvheadend instead!

  • 4 months later...
sundevil67
Posted

Anything like this that'd run in MacOS by any chance?

sundevil67
Posted
On 2/4/2024 at 2:26 PM, trix77 said:

It should run under mono on MacOS, but untested:

https://www.mono-project.com/docs/getting-started/install/mac/

Thanks ... It's nice to know someone's figured out how to do this with the same provider I use...been looking for something like this for ages...but the implementation is waaay over my head. I appreciate the reply.

Posted

Hello @trix77

thank you for this great script.

I'm using this script on both Windows and Debian (with Mono).

However, I'm encountering an issue with a server using "HTTPS" under Debian and Mono, with an
=> error: PM: ERROR: Error: TrustFailure (Authentication failed, see inner exception.)

I've updated the SSH keys with Mono and tried various things, but without success.

Do you have any idea how to solve this problem or work around it?
Just for your information, the same HTTPS server works perfectly fine under Windows.

Thank you trix77

Posted
4 hours ago, Nastream said:

Hello @trix77

thank you for this great script.

I'm using this script on both Windows and Debian (with Mono).

However, I'm encountering an issue with a server using "HTTPS" under Debian and Mono, with an
=> error: PM: ERROR: Error: TrustFailure (Authentication failed, see inner exception.)

I've updated the SSH keys with Mono and tried various things, but without success.

Do you have any idea how to solve this problem or work around it?
Just for your information, the same HTTPS server works perfectly fine under Windows.

Thank you trix77

I'm just guessing here, what version of Debian? Did you do sudo apt update and sudo apt upgrade ? Sound like the problems lies in not updating the certificates.

Posted

Hello @trix77

I am in Debian version 11 and the apt update and upgrade are updated correctly

Is it possible to bypass the verification of SSL certificates?

Posted
Good morning,
I solved the problem with this command line:
Quote

sed -i 's/^mozilla\/DST_Root_CA_X3.crt$/!mozilla\/DST_Root_CA_X3.crt/' /etc/ca-certificates.conf
update-ca-certificates
cert-sync /etc/ssl/certs/ca-certificates.crt

thanks again for this great script

 

  • Thanks 1
  • 2 months later...
Posted

Hello just started to use your script and noticed the vod movies have not been placed in folders, am I missing anything?

Thanks

grimevil
Posted
18 hours ago, Webdoc said:

Hello just started to use your script and noticed the vod movies have not been placed in folders, am I missing anything?

Thanks

I have the same issue, all movies are just in each folder.

example

\netflix\film (year).strm

\netflix\film2 (year).strm

instead of

\netflix\film (year)\film (year).strm

\netflix\film2 (year)\film (year).strm

 

  • 8 months later...
Radical924
Posted
On 20/04/2024 at 01:16, grimevil said:

I have the same issue, all movies are just in each folder.

example

\netflix\film (year).strm

\netflix\film2 (year).strm

instead of

\netflix\film (year)\film (year).strm

\netflix\film2 (year)\film (year).strm

 

You need to set the setting "MovieGroupSubdirEnabled" in the config file after creating it with /c command to "True". Follow the instructions on the github page https://github.com/trix7777/m2strm?tab=readme-ov-file

  • 3 weeks later...
grimevil
Posted
On 24/12/2024 at 11:46, Radical924 said:

You need to set the setting "MovieGroupSubdirEnabled" in the config file after creating it with /c command to "True". Follow the instructions on the github page https://github.com/trix7777/m2strm?tab=readme-ov-file

I have the option set in my config

 <add key="MoviesSubDir" value="Movies" />
        <add key="SeriesSubDir" value="Series" />
        <add key="TVSubDir" value="TV" />
        <add key="DeletePreviousDirEnabled" value="False" />
        <add key="UnwantedCFGEnabled" value="True" />
        <add key="VerboseConsoleOutputEnabled" value="True" />
        <add key="ProgramLogEnabled" value="True" />
        <add key="PurgeFilesEnabled" value="True" />
        <add key="SeriesGroupSubdirEnabled" value="True" />
        <add key="MovieGroupSubdirEnabled" value="True" />
        <add key="DownloadM3U8Enabled" value="True" />
 

It still does not create separate folders for each movie, I can send you the log if it helps debug it and screenshots of the folder setup?

 

 

 

image.png

Posted (edited)
29 minutes ago, grimevil said:

I have the option set in my config

 <add key="MoviesSubDir" value="Movies" />
        <add key="SeriesSubDir" value="Series" />
        <add key="TVSubDir" value="TV" />
        <add key="DeletePreviousDirEnabled" value="False" />
        <add key="UnwantedCFGEnabled" value="True" />
        <add key="VerboseConsoleOutputEnabled" value="True" />
        <add key="ProgramLogEnabled" value="True" />
        <add key="PurgeFilesEnabled" value="True" />
        <add key="SeriesGroupSubdirEnabled" value="True" />
        <add key="MovieGroupSubdirEnabled" value="True" />
        <add key="DownloadM3U8Enabled" value="True" />
 

It still does not create separate folders for each movie, I can send you the log if it helps debug it and screenshots of the folder setup?

 

 

 

image.png

I'm sorry, but the MovieGroupSubdirEnabled option is for groups, there is no option to create a separate directory for each movie. I know this feature has been requested before, but I have not implemented it yet and I have no plans to work on this application at the moment. I still don't understand why on earth you would want to do this?

Edited by trix77
.
  • Like 1
  • 2 months later...
MajidKorai
Posted

Old topic, but I think it's worth posting here. I went through hassle of converting m3u files to strm previously and spent a lot of time trying to make these python based tools to work. Sometimes they work sometimes they don't and result is also not the same as you want it to be. 

But recently I found an online tool for doing that.

https://m3u2stream.talkingtech.io/

It's simple to use, create an account and upload your file and wait for a few minutes for tool to process the files for you, then just download the strm files in zip folder format. 

Tool has a small subscription fee to use it, which allows you to convert as many files as you want for a week or so.  

trix77
Posted (edited)
2 hours ago, MajidKorai said:

... spent a lot of time trying to make these python based tools to work ...

I don't know why you felt the need to hijack my thread writing about a certain online tool that might or might not be malicious. Kindly, please refrain from using this thread to spam. Also, the app that I've written is open source and can easily be forked or/and checked, it's written in 100% C#, no python there.

Edited by trix77

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