•   
  • 1
  • 45
  • 46
  • 47
  • 48
  • 49(current)
SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)
hi i have a very limited idea how to use this. so if possible can someone help me.
i have completed this section
Make sure you have Perl installed. 
If you are using Windows I recommend Strawberry Perl. Linux and Mac OS X often have Perl already installed.
On Mac OS X you may need to install the CLI developer tools.

Extract the SortTV script (sorttv.pl etc) wherever you like. 
For example, on Linux into /home/[yourusername]/sorttv/

Edit the sorttv.conf file to the settings you want (at minimum specify the location of the directories to sort from and to)

Install the modules the script uses.
To do so, run this command on Linux or Mac OS X:
sudo cpan File::Copy::Recursive File::Glob LWP::Simple TVDB::API Getopt::Long Switch WWW::TheMovieDB::Search XML::Simple
On Windows run the same command, without "sudo"


this bit didnt work 5 * * * * nice perl /home/cliffe/sorttv/sorttv.pl

and then i am unsure what to do then
do i edit the conf file. 
i really want to just organise the tv shows in my download folder to the video/tv/show/season/episode#

thank you in advance
Reply
First that specific part is for automation so not needed if you just want to test it out and the 5 * * * * part is for Linux, are you running a Linux system?

You can skip that part and just do this part "The simplest way to use SortTV is to edit the example config file, then just run "perl sorttv.pl" to do the sorting".
If you find any spelling mistakes you can keep them ;)
Reply
Linux mint.

Could you explain what I need to put in the config file please.
Reply
Well to start you only need to put something in "directory-to-sort=" and "tv-directory=". And make sure you remove the # (if there is one) on the line to make it active.
The rest is optional, but you could read through it to know how to fine tune the script.
If you find any spelling mistakes you can keep them ;)
Reply
Is there somebody else maintaining this? Now it's completely broken, it gives me XML errors. So probably TVDB or something has changed something.
Samsung ES7005 55" led tv - Denon AVR-3313 - NAD C275BEE - B&W DM683 - B&W HTM61 - B&W 686
Intel NUC D34010WYK - 128GB Crucial ssd, Built in IR Receiver
And a Logitech Harmony Touch to control it all. https://libreelec.tv
Retired: Asus EB1501P ION2 - OCZ Vertex 2 64gb ssd - Built in IR Receiver
Reply
(2019-12-20, 20:00)newphreak Wrote: Is there somebody else maintaining this? Now it's completely broken, it gives me XML errors. So probably TVDB or something has changed something.

No one has taken over it no, but I'm still using it and try to fix it when I can.
I just ran it without any problems so not sure why it's not working for you, can you give some more information about the errors you get and what you tried to use it on.
If you find any spelling mistakes you can keep them ;)
Reply
These sorts of failures:
Quote:INFO: Currently checking file: Dollface.S01E01.720p.WhatEver
INFO: trying to move Dollface season 1 episode 1
Only Comments, PIs and whitespace allowed at end of document [Ln: 1, Col: 279262520512940736]
XML::Simple called at /usr/local/share/perl/5.26.1/TVDB/API.pm line 260.
Quote:INFO: Currently checking file: Chernobyl.S01E01.720p.WhatEver
INFO: trying to move Chernobyl season 1 episode 1
Only Comments, PIs and whitespace allowed at end of document [Ln: 1, Col: 279191193823687344]
XML::Simple called at /usr/local/share/perl/5.26.1/TVDB/API.pm line 260.
Samsung ES7005 55" led tv - Denon AVR-3313 - NAD C275BEE - B&W DM683 - B&W HTM61 - B&W 686
Intel NUC D34010WYK - 128GB Crucial ssd, Built in IR Receiver
And a Logitech Harmony Touch to control it all. https://libreelec.tv
Retired: Asus EB1501P ION2 - OCZ Vertex 2 64gb ssd - Built in IR Receiver
Reply
Oh that seems like a problem with the TVDB module and not with the script itself, I don't know if you can find some help there but I think it's quite dead too sadly.
It could be on the server end too, I had a quick look at the TVDB forum and it seems like a lot of ppl are having problems.

Atm I don't have time to look into it so much deeper but maybe I'll have a look after the holidays.
If you find any spelling mistakes you can keep them ;)
Reply
(2019-12-21, 20:14)newphreak Wrote: These sorts of failures:
Quote:INFO: Currently checking file: Dollface.S01E01.720p.WhatEver
INFO: trying to move Dollface season 1 episode 1
Only Comments, PIs and whitespace allowed at end of document [Ln: 1, Col: 279262520512940736]
XML::Simple called at /usr/local/share/perl/5.26.1/TVDB/API.pm line 260.
Quote:INFO: Currently checking file: Chernobyl.S01E01.720p.WhatEver
INFO: trying to move Chernobyl season 1 episode 1
Only Comments, PIs and whitespace allowed at end of document [Ln: 1, Col: 279191193823687344]
XML::Simple called at /usr/local/share/perl/5.26.1/TVDB/API.pm line 260.
I've created an incredible hacky fix for now.
locate TVDB/API.pm mine was in "/usr/local/share/perl5/5.30/TVDB/API.pm"
add the following line:

        if ($xml =~ s/<\/Data><\?xml.*?Banners>|<\/Banners><\?xml.*?Actors>//gs) {
                $xml =~ s/<\/Actors>$/<\/Data>/s;
        }
        $xml =~ s/<\/Data><Banners>.*/<\/Data>/; #VERY DODGEY FIX
        # Remove empty tags
For me this was added between line 251 and 252 under the sub '_downloadZip'
All this bodge does is remove the banners and actors information from the xml and only parses the <Data> portion.
The xml coming back is now <Data></Data><Banners></Banners><Actors></Actors> so it is not parsing correctly as they are 3 seperate xml documents. I thought of wrapping them them in a <Document> tag but that broke other parts of code.

NOTE: this will probably break TVDB for anything other perl script that imports it. As I run mine in a container I don't really care.
Reply
(2020-01-04, 07:06)itachi46 Wrote: I've created an incredible hacky fix for now.
locate TVDB/API.pm mine was in "/usr/local/share/perl5/5.30/TVDB/API.pm"
add the following line:

        if ($xml =~ s/<\/Data><\?xml.*?Banners>|<\/Banners><\?xml.*?Actors>//gs) {
                $xml =~ s/<\/Actors>$/<\/Data>/s;
        }
        $xml =~ s/<\/Data><Banners>.*/<\/Data>/; #VERY DODGEY FIX
        # Remove empty tags
For me this was added between line 251 and 252 under the sub '_downloadZip'
All this bodge does is remove the banners and actors information from the xml and only parses the <Data> portion.
The xml coming back is now <Data></Data><Banners></Banners><Actors></Actors> so it is not parsing correctly as they are 3 seperate xml documents. I thought of wrapping them them in a <Document> tag but that broke other parts of code.

NOTE: this will probably break TVDB for anything other perl script that imports it. As I run mine in a container I don't really care. 

I think a simpler version that should work is to just remove the \?xml.*? part from
if ($xml =~ s/<\/Data><\?xml.*?Banners>|<\/Banners><\?xml.*?Actors>//gs) {
    $xml =~ s/<\/Actors>$/<\/Data>/s;
}
so you end up with this
if ($xml =~ s/<\/Data><Banners>|<\/Banners><Actors>//gs) {
    $xml =~ s/<\/Actors>$/<\/Data>/s;
}

This will wrap the <Data> tag around all 3 files, that way you keep all the information and hopefully wont run into trouble later on.
I never looked at these xml files before so not sure why the regex was like it was before but something probably changed so this is the way we have to do it now.
If you find any spelling mistakes you can keep them ;)
Reply
Hi,

Ive just tried to install sorttv, and gettings this error:

Can't locate TVDB/API.pm in @INC (you may need to install the TVDB::API module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.26.1 /usr/local/share/perl/5.26.1 /usr/lib/x86_64-linux-gnu/perl5/5.26 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.26 /usr/share/perl/5.26 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base) at ./sorttv.pl line 57.
BEGIN failed--compilation aborted at ./sorttv.pl line 57.

Tried cpan TVDB::API etc, but still no sorting. Any takers?
Reply
  •   
  • 1
  • 45
  • 46
  • 47
  • 48
  • 49(current)
 
Thread Rating:
  • 8 Vote(s) - 4.88 Average



Logout Mark Read Team Forum Stats Members Help
SortTV: Sort TV episodes, movies, and music into directories for xbmc (Linux/Win/Mac)4.888
This forum uses Lukasz Tkacz MyBB addons.