Export a .txt file

To discuss development of addons / skins / customization of MediaMonkey.

Moderators: jiri, drakinite, Addon Administrators

jimcin4
Posts: 3
Joined: Thu Nov 11, 2021 7:45 pm

Export a .txt file

Post by jimcin4 »

Hello Team,
I have just recently started using MM5 to autotag and organize my movie collection. Would it be possible to include an option or script to pull the information from the comment section of file properties (after autotaging it is the movie plot/synopsis) and create a .txt file in the same folder as the movie?
Any thoughts or suggestions would be appreciated.

Thanks
Jim
Peke
Posts: 17501
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Export a .txt file

Post by Peke »

Hi,
Are you referring to NFO file containing All metadata?

Can you attach content of of TXT file in < code > mask?

Like these:

Code: Select all

<movie>
  <title>Battle Beyond the Stars</title>
  <originaltitle>Battle Beyond the Stars</originaltitle>
  <sorttitle>battle beyond stars</sorttitle>
  <ratings>
    <rating name="themoviedb" max="10" default="true">
      <value>5.6</value>
      <votes>111</votes>
    </rating>
  </ratings>
  <rating>5.6</rating>
  <userrating />
  <top250 />
  <outline />
  <plot>A young farmer assembles a band of diverse mercenaries to defend his peaceful planet from an evil tyrant.</plot>
  <tagline />
  <runtime>104</runtime>
  <thumb aspect="poster" preview="https://image.tmdb.org/t/p/original/2zFS608xVM8tSm6ykfnGV4ZQfag.jpg">https://image.tmdb.org/t/p/original/2zFS608xVM8tSm6ykfnGV4ZQfag.jpg</thumb>
  <fanart>
    <thumb preview="https://image.tmdb.org/t/p/original/8SenmQwjKGX912vakeSiti9wR1P.jpg">https://image.tmdb.org/t/p/original/8SenmQwjKGX912vakeSiti9wR1P.jpg</thumb>
  </fanart>
  <mpaa>PG</mpaa>
  <playcount />
  <lastplayed />
  <id>14460</id>
  <uniqueid type="tmdb" default="true">14460</uniqueid>
  <uniqueid type="imdb">tt0080421</uniqueid>
  <genre>Science Fiction</genre>
  <country />
  <credits>John Sayles</credits>
  <director>Jimmy T. Murakami</director>
  <premiered>1980-09-08</premiered>
  <year>1980</year>
  <studio>New World Pictures</studio>
  <trailer>https://www.youtube.com/watch?v=2t7z_44nGio</trailer>
</movie>

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
    <title>Streets of Fire</title>
    <originaltitle>Streets of Fire</originaltitle>
    <sorttitle></sorttitle>
    <rating>6.8</rating>
    <year>1984</year>
    <top250></top250>
    <votes>69</votes>
    <outline>Raven Shaddock and his gang of merciless biker friends kidnap rock singer Ellen Aim. Ellen's former lover, soldier-for-hire Tom Cody, happens to be passing through town on a visit. In an attempt to save...</outline>
    <plot>Raven Shaddock and his gang of merciless biker friends kidnap rock singer Ellen Aim. Ellen's former lover, soldier-for-hire Tom Cody, happens to be passing through town on a visit. In an attempt to save his star act, Ellen's manager hires Tom to rescue her. Along with a former soldier, they battle through dangerous cityscapes, determined to get Ellen back.</plot>
    <tagline>Tonight is what it means to be young.</tagline>
    <runtime>93</runtime>
    <thumb>http://image.tmdb.org/t/p/w500/cbd7haj22LgogH8PycigSVmCNY7.jpg</thumb>
    <fanart>http://assets.fanart.tv/fanart/movies/14746/moviebackground/streets-of-fire-5208f3a4c9063.jpg</fanart>
    <mpaa>Rated PG</mpaa>
    <certification>US:PG / US:Rated PG</certification>
    <id>tt0088194</id>
    <ids>
        <entry>
            <key>tmdb</key>
            <value xsi:type="xs:int" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">14746</value>
        </entry>
        <entry>
            <key>imdb</key>
            <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">tt0088194</value>
        </entry>
    </ids>
    <tmdbId>14746</tmdbId>
    <trailer>plugin://plugin.video.youtube/?action=play_video&amp;videoid=oJGo2rvfSuA</trailer>
    <country>United States of America</country>
    <premiered>1984-06-01</premiered>
    <fileinfo>
        <streamdetails>
            <video>
                <codec>DivX</codec>
                <aspect>1.78</aspect>
                <width>640</width>
                <height>360</height>
                <durationinseconds>5626</durationinseconds>
            </video>
            <audio>
                <codec>MP3</codec>
                <language></language>
                <channels>2</channels>
            </audio>
            <subtitle>
                <language>eng</language>
            </subtitle>
            <subtitle>
                <language></language>
            </subtitle>
        </streamdetails>
    </fileinfo>
    <watched>true</watched>
    <playcount>1</playcount>
    <genre>Action</genre>
    <genre>Thriller</genre>
    <genre>Music</genre>
    <studio>Universal Pictures</studio>
    <credits>Larry Gross</credits>
    <credits>Walter Hill</credits>
    <director>Walter Hill</director>
    <actor>
        <name>Michael Paré</name>
        <role>Tom Cody</role>
        <thumb>http://image.tmdb.org/t/p/w185/g1cVLWWAgl3J1nNFhg67qXs8GUT.jpg</thumb>
    </actor>
    <actor>
        <name>Diane Lane</name>
        <role>Ellen Aim</role>
        <thumb>http://image.tmdb.org/t/p/w185/lAsVLA16pQ8DH7lzwFyIV4ZIlQ8.jpg</thumb>
    </actor>
    <actor>
        <name>Rick Moranis</name>
        <role>Billy Fish</role>
        <thumb>http://image.tmdb.org/t/p/w185/27dRb7OyRGzQP8D4tzyY6dEdmQY.jpg</thumb>
    </actor>
    <actor>
        <name>Amy Madigan</name>
        <role>McCoy</role>
        <thumb>http://image.tmdb.org/t/p/w185/pNdNJPKRdl3veCRH8fZv3H76ywJ.jpg</thumb>
    </actor>
    <actor>
        <name>Willem Dafoe</name>
        <role>Raven Shaddock</role>
        <thumb>http://image.tmdb.org/t/p/w185/xM5lhOR5tWWdIlFpBDeZJx9opIP.jpg</thumb>
    </actor>
    <actor>
        <name>Bill Paxton</name>
        <role>Clyde the Bartender</role>
        <thumb>http://image.tmdb.org/t/p/w185/53Ln1wTC0OCLzBF4HNlwhMXYgOU.jpg</thumb>
    </actor>
    <actor>
        <name>Deborah Van Valkenburgh</name>
        <role>Reva Cody</role>
        <thumb>http://image.tmdb.org/t/p/w185/d17eio3cj1iwwtFR927oKCou681.jpg</thumb>
    </actor>
    <actor>
        <name>Kathy Griffin</name>
        <role>Concertgoer</role>
        <thumb>http://image.tmdb.org/t/p/w185/s77yQ2JLzn8tKtmeTvj74DfYeTf.jpg</thumb>
    </actor>
    <actor>
        <name>E.G. Daily</name>
        <role>Baby Doll</role>
        <thumb>http://image.tmdb.org/t/p/w185/kGnTMLGU7evSMvpoFQ1ImCP0h1H.jpg</thumb>
    </actor>
    <producer>
        <name>Lawrence Gordon</name>
        <role>Producer</role>
        <thumb>http://image.tmdb.org/t/p/w185/hcjzZT71C7bKzhkgL6TAcEjsmkS.jpg</thumb>
    </producer>
    <producer>
        <name>Joel Silver</name>
        <role>Producer</role>
        <thumb>http://image.tmdb.org/t/p/w185/1LIjLDXGRhwXohHL2jKhyvLv0rZ.jpg</thumb>
    </producer>
    <languages>English</languages>
</movie>
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Barry4679
Posts: 2429
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia
Contact:

Re: Export a .txt file

Post by Barry4679 »

Peke wrote: Sun Mar 17, 2024 8:58 pm Are you referring to NFO file containing All metadata?
Peke, that seems a random response, almost assured to generate confusion.

I read the query as:
  • The OP has started tagging his collection
  • Has movie synopsis stored in the MM Comment tag for video media
  • Is asking whether MM5 has option or addon which will read the MM database, and output a .txt file, into the same folder as the movie, containing contents from the Comments tag
I would guess that like me, the OP has no idea what a NFO file is.
I googled it. From wikipedia:
is a filename extension for text files that accompany warez scene releases of pirated software or media
This seems well outside the scope of the original question.
Want a dark skin for MM5? This is the one that works best for me .. elegant, compact & clear.
Peke
Posts: 17501
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Export a .txt file

Post by Peke »

Hi,
Barry4679 wrote: Mon Mar 18, 2024 2:05 am Peke, that seems a random response, almost assured to generate confusion.
???
Not sure what you are talking about :) It is standard for Video Files :) used by many many Sites like:
https://www.themoviedb.org/
https://thetvdb.com/
https://imdb.com/
https://trakt.tv/
https://www.tvmaze.com/
https://www.imdb.com/
and beside MM apps like QNAP/Synology/WD/D-Link Media Server, PLEX, Kodi, Emby, Twonky, Sonarr, Radarr, ..., also many Smart TVs (tested on Multiple manufacturers) and even online apps like https://nfo-maker.com/ all use NFO/XML format for metadata.

It is defacto standard as many Video Files require to be re-encoded (re-muxed in best case) in order to contain modified metadata, so there is standard that most (if not all apps now support). Reason for that is fingerprinting and proof of antithetic source (Dash Cams have embed metadata, so that they can be use in court and usually can't changed or will not be accepted as evidence).
Barry4679 wrote: Mon Mar 18, 2024 2:05 am I read the query as:

The OP has started tagging his collection
Has movie synopsis stored in the MM Comment tag for video media
Is asking whether MM5 has option or addon which will read the MM database, and output a .txt file, into the same folder as the movie, containing contents from the Comments tag
Then yes, CVS file is text file, HTML is text File showing listing. I really doubt he mean that as its usefulness is questionable.
Barry4679 wrote: Mon Mar 18, 2024 2:05 am I would guess that like me, the OP has no idea what a NFO file is.
I googled it. From wikipedia:

is a filename extension for text files that accompany warez scene releases of pirated software or media

This seems well outside the scope of the original question.
Well Google is wrong, .NFO file is Windows System Info save File :) and refer as iNFO file :) But you are right many Windows apps are bloatware and how much data they leak could be considered dangerous. You really made my day. Thank you, it is a good joke. Joking aside, yes .NFO is adopted way back in early 90's by Hacking/Demo/Trial scene as way to parse ANSI Graphics and Descriptions alongside releases (including hack reports, applications, distributions, presentations, BBS ...) which contain detailed iNFOrmation what it contains and to track source of files. Often archives without such files are considered red flag and potentially dangerous due the fact often Viruses/Trojans/Ransomwares mask them self in plain archives without NFO.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Barry4679
Posts: 2429
Joined: Fri Sep 11, 2009 8:07 am
Location: Australia
Contact:

Re: Export a .txt file

Post by Barry4679 »

Peke wrote: Mon Mar 18, 2024 7:58 amI really doubt he mean that as its usefulness is questionable.
OK, we wait for clarification from OP.

I was assuming that aim was to generate a text file alongside each movie, for use outside of MM.
In which case your response would cause much confusion.

I didn't notice that the post was in the Developer Form, so the OP may be more techy than I was assuming, in which case I would be wrong.
Want a dark skin for MM5? This is the one that works best for me .. elegant, compact & clear.
Peke
Posts: 17501
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Export a .txt file

Post by Peke »

Hi,
No worries, I am too old (hush) as I was in those times when standard was introduced and mass accepted/debated.
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
jimcin4
Posts: 3
Joined: Thu Nov 11, 2021 7:45 pm

Re: Export a .txt file

Post by jimcin4 »

Peke wrote: Sun Mar 17, 2024 8:58 pm Hi,
Are you referring to NFO file containing All metadata?

Can you attach content of of TXT file in < code > mask?

Like these:

Code: Select all

<movie>
  <title>Battle Beyond the Stars</title>
  <originaltitle>Battle Beyond the Stars</originaltitle>
  <sorttitle>battle beyond stars</sorttitle>
  <ratings>
    <rating name="themoviedb" max="10" default="true">
      <value>5.6</value>
      <votes>111</votes>
    </rating>
  </ratings>
  <rating>5.6</rating>
  <userrating />
  <top250 />
  <outline />
  <plot>A young farmer assembles a band of diverse mercenaries to defend his peaceful planet from an evil tyrant.</plot>
  <tagline />
  <runtime>104</runtime>
  <thumb aspect="poster" preview="https://image.tmdb.org/t/p/original/2zFS608xVM8tSm6ykfnGV4ZQfag.jpg">https://image.tmdb.org/t/p/original/2zFS608xVM8tSm6ykfnGV4ZQfag.jpg</thumb>
  <fanart>
    <thumb preview="https://image.tmdb.org/t/p/original/8SenmQwjKGX912vakeSiti9wR1P.jpg">https://image.tmdb.org/t/p/original/8SenmQwjKGX912vakeSiti9wR1P.jpg</thumb>
  </fanart>
  <mpaa>PG</mpaa>
  <playcount />
  <lastplayed />
  <id>14460</id>
  <uniqueid type="tmdb" default="true">14460</uniqueid>
  <uniqueid type="imdb">tt0080421</uniqueid>
  <genre>Science Fiction</genre>
  <country />
  <credits>John Sayles</credits>
  <director>Jimmy T. Murakami</director>
  <premiered>1980-09-08</premiered>
  <year>1980</year>
  <studio>New World Pictures</studio>
  <trailer>https://www.youtube.com/watch?v=2t7z_44nGio</trailer>
</movie>

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<movie>
    <title>Streets of Fire</title>
    <originaltitle>Streets of Fire</originaltitle>
    <sorttitle></sorttitle>
    <rating>6.8</rating>
    <year>1984</year>
    <top250></top250>
    <votes>69</votes>
    <outline>Raven Shaddock and his gang of merciless biker friends kidnap rock singer Ellen Aim. Ellen's former lover, soldier-for-hire Tom Cody, happens to be passing through town on a visit. In an attempt to save...</outline>
    <plot>Raven Shaddock and his gang of merciless biker friends kidnap rock singer Ellen Aim. Ellen's former lover, soldier-for-hire Tom Cody, happens to be passing through town on a visit. In an attempt to save his star act, Ellen's manager hires Tom to rescue her. Along with a former soldier, they battle through dangerous cityscapes, determined to get Ellen back.</plot>
    <tagline>Tonight is what it means to be young.</tagline>
    <runtime>93</runtime>
    <thumb>http://image.tmdb.org/t/p/w500/cbd7haj22LgogH8PycigSVmCNY7.jpg</thumb>
    <fanart>http://assets.fanart.tv/fanart/movies/14746/moviebackground/streets-of-fire-5208f3a4c9063.jpg</fanart>
    <mpaa>Rated PG</mpaa>
    <certification>US:PG / US:Rated PG</certification>
    <id>tt0088194</id>
    <ids>
        <entry>
            <key>tmdb</key>
            <value xsi:type="xs:int" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">14746</value>
        </entry>
        <entry>
            <key>imdb</key>
            <value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">tt0088194</value>
        </entry>
    </ids>
    <tmdbId>14746</tmdbId>
    <trailer>plugin://plugin.video.youtube/?action=play_video&amp;videoid=oJGo2rvfSuA</trailer>
    <country>United States of America</country>
    <premiered>1984-06-01</premiered>
    <fileinfo>
        <streamdetails>
            <video>
                <codec>DivX</codec>
                <aspect>1.78</aspect>
                <width>640</width>
                <height>360</height>
                <durationinseconds>5626</durationinseconds>
            </video>
            <audio>
                <codec>MP3</codec>
                <language></language>
                <channels>2</channels>
            </audio>
            <subtitle>
                <language>eng</language>
            </subtitle>
            <subtitle>
                <language></language>
            </subtitle>
        </streamdetails>
    </fileinfo>
    <watched>true</watched>
    <playcount>1</playcount>
    <genre>Action</genre>
    <genre>Thriller</genre>
    <genre>Music</genre>
    <studio>Universal Pictures</studio>
    <credits>Larry Gross</credits>
    <credits>Walter Hill</credits>
    <director>Walter Hill</director>
    <actor>
        <name>Michael Paré</name>
        <role>Tom Cody</role>
        <thumb>http://image.tmdb.org/t/p/w185/g1cVLWWAgl3J1nNFhg67qXs8GUT.jpg</thumb>
    </actor>
    <actor>
        <name>Diane Lane</name>
        <role>Ellen Aim</role>
        <thumb>http://image.tmdb.org/t/p/w185/lAsVLA16pQ8DH7lzwFyIV4ZIlQ8.jpg</thumb>
    </actor>
    <actor>
        <name>Rick Moranis</name>
        <role>Billy Fish</role>
        <thumb>http://image.tmdb.org/t/p/w185/27dRb7OyRGzQP8D4tzyY6dEdmQY.jpg</thumb>
    </actor>
    <actor>
        <name>Amy Madigan</name>
        <role>McCoy</role>
        <thumb>http://image.tmdb.org/t/p/w185/pNdNJPKRdl3veCRH8fZv3H76ywJ.jpg</thumb>
    </actor>
    <actor>
        <name>Willem Dafoe</name>
        <role>Raven Shaddock</role>
        <thumb>http://image.tmdb.org/t/p/w185/xM5lhOR5tWWdIlFpBDeZJx9opIP.jpg</thumb>
    </actor>
    <actor>
        <name>Bill Paxton</name>
        <role>Clyde the Bartender</role>
        <thumb>http://image.tmdb.org/t/p/w185/53Ln1wTC0OCLzBF4HNlwhMXYgOU.jpg</thumb>
    </actor>
    <actor>
        <name>Deborah Van Valkenburgh</name>
        <role>Reva Cody</role>
        <thumb>http://image.tmdb.org/t/p/w185/d17eio3cj1iwwtFR927oKCou681.jpg</thumb>
    </actor>
    <actor>
        <name>Kathy Griffin</name>
        <role>Concertgoer</role>
        <thumb>http://image.tmdb.org/t/p/w185/s77yQ2JLzn8tKtmeTvj74DfYeTf.jpg</thumb>
    </actor>
    <actor>
        <name>E.G. Daily</name>
        <role>Baby Doll</role>
        <thumb>http://image.tmdb.org/t/p/w185/kGnTMLGU7evSMvpoFQ1ImCP0h1H.jpg</thumb>
    </actor>
    <producer>
        <name>Lawrence Gordon</name>
        <role>Producer</role>
        <thumb>http://image.tmdb.org/t/p/w185/hcjzZT71C7bKzhkgL6TAcEjsmkS.jpg</thumb>
    </producer>
    <producer>
        <name>Joel Silver</name>
        <role>Producer</role>
        <thumb>http://image.tmdb.org/t/p/w185/1LIjLDXGRhwXohHL2jKhyvLv0rZ.jpg</thumb>
    </producer>
    <languages>English</languages>
</movie>
Thanks for the reply Peke,

I believe that getting the information from the .nfo file would be a lil much, (or just as easy, IDK, not savvy when it comes this stuff), just something to pull the info from the comment section (after the auto tag) and create a .txt file with the title of "synopsis" or "plot" and save it in the same folder as the Movie title. Just would be a cool lil addon I think
Jim
Peke
Posts: 17501
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Export a .txt file

Post by Peke »

Hi,
jimcin4 wrote: Tue Mar 19, 2024 1:27 am I believe that getting the information from the .nfo file would be a lil much, (or just as easy, IDK, not savvy when it comes this stuff), just something to pull the info from the comment section (after the auto tag) and create a .txt file with the title of "synopsis" or "plot" and save it in the same folder as the Movie title.
Hmmm, May I ask what would be the intention for the TXT file? Eg. do you plan to use it for reading info on movie or use with another app or ???
Try Windows non installation version of https://github.com/Radarr/Radarr/releases for Movies and https://github.com/Sonarr/Sonarr for TV series and let me know if that is what you seek as end result?
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
jimcin4
Posts: 3
Joined: Thu Nov 11, 2021 7:45 pm

Re: Export a .txt file

Post by jimcin4 »

It is merely just for my collection. If the wife/kids/grandkids wanted to watch something and not sure what it's about, just look at the text file and see if it would interest them.

Since I was using mm5 to organize the collection anyway, I thought it would just be nice addition and one less step in my organizing of the folders

I'll certainly look into those options you mentioned and see if that's what I am looking for.

Thanks for your attention
Jim
Peke
Posts: 17501
Joined: Tue Jun 10, 2003 7:21 pm
Location: Earth
Contact:

Re: Export a .txt file

Post by Peke »

Hi,
Benefit of both Sonarr and Radarr is that they are both accessible over WEB, so locally anyone connected to local WiFi can browse your collection and then choose what to watch ;)
Best regards,
Peke
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
Image
How to attach PICTURE/SCREENSHOTS to forum posts
Ludek
Posts: 4964
Joined: Fri Mar 09, 2007 9:00 am

Re: Export a .txt file

Post by Ludek »

jimcin4 wrote: Fri Mar 15, 2024 4:29 am Hello Team,
I have just recently started using MM5 to autotag and organize my movie collection. Would it be possible to include an option or script to pull the information from the comment section of file properties (after autotaging it is the movie plot/synopsis) and create a .txt file in the same folder as the movie?
Any thoughts or suggestions would be appreciated.

Thanks
This is easily doable by an addon, as an code example you can get e.g. clearFields script: https://www.mediamonkey.com/addons/brow ... ar-fields/
and instead of the code for clearing the fields (function clearMetaData(lst)) you can put something like:

Code: Select all

asyncForEach(lst, (lstItem, next) => {
	lstItem.getCommentAsync().then((comment) => {
		app.filesystem.saveTextToFileAsync(lstItem.path+'.comment.txt', comment).then(next);
	});
});
Post Reply