Blauwbek / pySabRename

pySabRename, the solution for all your renaming requests
8 stars 4 forks source link

NZBget support #7

Open Magikarplvl4 opened 8 years ago

Magikarplvl4 commented 8 years ago

Hi,

is it also possible to use it in NZBget?

Blauwbek commented 8 years ago

Probably not at this point

Magikarplvl4 commented 8 years ago

Is it possible get support for NZBget? I like to use this script :+1:

Blauwbek commented 8 years ago

I will check it out, if its not too much work, sure...

Blauwbek commented 8 years ago

Can you test this please https://github.com/Blauwbek/pySabRename/blob/nzbget_dev/pySabRename_nzbget_win.py

Magikarplvl4 commented 8 years ago

wow that was fast. can't select the script in the menu for starting the script :(

image

Blauwbek commented 8 years ago

Can you try my latest revision?

Magikarplvl4 commented 8 years ago

It is working!!! excellent

Blauwbek commented 8 years ago

Great, I've merged the changes

Blauwbek commented 8 years ago

Could you maybe create a small how to install for nzbget? Im not very familiar with it.

WzL commented 8 years ago

A small howto would be great because, i only get the following logging from NZBGet: NZBGet: pySabRename_nzbget_win: failure.

Blauwbek commented 8 years ago

Do you have the latest NZBGET?

WzL commented 8 years ago

Currently installed: 17.0-testing-r1716 No updates are available for your platform. Stable Official releases 16.4 Testing release notes 17.0-r1716 Development release notes 17.0-r1726

The cause of the failure may simply be me not knowing what the proper installation/configuration procedure is. So if @whitecollar17 would be so kind ...

Blauwbek commented 8 years ago

I will check if I can maybe expose some more logs to nzbget. But I dont use it myself, which makes it somewhat difficult :(

WzL commented 8 years ago

I am more than willing to help in terms of testing and what not. In the meantime i will dive into NZBGet and scripts.

Magikarplvl4 commented 8 years ago

hi, its look like its not working on the 17.0 test version. I work with with 16.4 and that is fine. I can make a how to. Give me a day for that.

Blauwbek commented 8 years ago

Okay, I will try to figure out why then. Thanks for making the how to 👍

WzL commented 8 years ago

Thanks for the response, i guess that's the risk of Running test Version of nzbget. I Will remove the test Version and install latest stable. If that works and blauwbek Does not find anything special i Will report a possible nzbget issue. Op 6 jun. 2016 14:48 schreef "Blauwbek" notifications@github.com:

Okay, I will try to figure out why then. Thanks for making the how to 👍

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Blauwbek/pySabRename/issues/7#issuecomment-223948739, or mute the thread https://github.com/notifications/unsubscribe/ABgor82QBF2XJ3IXgBLtjVkJio-qBCPRks5qJBcCgaJpZM4IgnOv .

WzL commented 8 years ago

Yesterday i removed NZBget Testing release 17.0-r1716 and installed NZBGet 16.4. Still i have the PostProcessingFailure message: pySabRename_nzbget_win: failure.

I´ll wait for the proposed howto to confirm correct nzbget configuration and move from there.

Blauwbek commented 8 years ago

Do you also have the pySR.cfg file in your path? (Just something that popped into my mind)

WzL commented 8 years ago

Errr must check that, but i do not think so. Op 8 jun. 2016 23:36 schreef "Blauwbek" notifications@github.com:

Do you also have the pySR.cfg file in your path?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Blauwbek/pySabRename/issues/7#issuecomment-224736552, or mute the thread https://github.com/notifications/unsubscribe/ABgor44HJHs31oxbuAjvSlVcJc36qMFAks5qJzXigaJpZM4IgnOv .

Blauwbek commented 8 years ago

That might very well be the cause of failing without any messages, as loading the config is one of the first things the script does... I might change this to NZBGET config later.

WzL commented 8 years ago

My bad, Let me test this and i Will return tomorrow with results. Op 8 jun. 2016 23:40 schreef "Blauwbek" notifications@github.com:

That might very well be the cause of failing without any messages, as loading the config is one of the first things the script does...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Blauwbek/pySabRename/issues/7#issuecomment-224737594, or mute the thread https://github.com/notifications/unsubscribe/ABgor3j6xGwEy27Gqjk77fiCjADO_kAyks5qJza3gaJpZM4IgnOv .

Blauwbek commented 8 years ago

Normally a nzbget script has config within the ui, but as this is a quick port it does not (yet)

WzL commented 8 years ago

Ok i added pySR.cfg to the scripts folder but still a fail during post processing. This time i have logging, my interpretation, it seems that something is not interpreted correctly or loaded correctly?:

error Thu Jun 09 2016 10:32:59 Post-process-script pySabRename_nzbget_win.py for Classical_Encounters_2010_1080p_WEB-DL_DD5_1_H264-FGT failed (terminated with unknown status) info Thu Jun 09 2016 10:32:59 pySabRename_nzbget_win: /opt/nzbget/scripts/pySabRename_nzbget_win.py: 35: /opt/nzbget/scripts/pySabRename_nzbget_win.py: Syntax error: "(" unexpected info Thu Jun 09 2016 10:32:59 pySabRename_nzbget_win: /opt/nzbget/scripts/pySabRename_nzbget_win.py: 32: /opt/nzbget/scripts/pySabRename_nzbget_win.py: import: not found info Thu Jun 09 2016 10:32:59 pySabRename_nzbget_win: /opt/nzbget/scripts/pySabRename_nzbget_win.py: 31: /opt/nzbget/scripts/pySabRename_nzbget_win.py: import: not found info Thu Jun 09 2016 10:32:59 pySabRename_nzbget_win: /opt/nzbget/scripts/pySabRename_nzbget_win.py: 30: /opt/nzbget/scripts/pySabRename_nzbget_win.py: import: not found info Thu Jun 09 2016 10:32:59 pySabRename_nzbget_win: /opt/nzbget/scripts/pySabRename_nzbget_win.py: 1: /opt/nzbget/scripts/pySabRename_nzbget_win.py: #!: not found info Thu Jun 09 2016 10:32:59 Executing post-process-script pySabRename_nzbget_win.py for Classical_Encounters_2010_1080p_WEB-DL_DD5_1_H264-FGT

WzL commented 8 years ago

Ok found the cause, i think whitecollar17 does not use NZBGet on a Linux system. I used Unix2dos command to accomplish the following:

Text files created on DOS/Windows machines have different line endings than files created on Unix/Linux. DOS uses carriage return and line feed ("\r\n") as a line ending, which Unix uses just line feed ("\n"). You need to be careful about transferring files between Windows machines and Unix machines to make sure the line endings are translated properly.

Command executed:
dos2unix pySabRename_nzbget_win.py
dos2unix pySR.cfg

After that:


./pySabRename_nzbget_win.py
pySabRename

             _____       _    ______
            /  ___|     | |   | ___ \
 _ __  _   _\ `--.  __ _| |__ | |_/ /___ _ __   __ _ _ __ ___   ___
| '_ \| | | |`--. \/ _` | '_ \|    /| _ \ '_ \ / _` | '_ ` _ \ / _ \
| |_) | |_| /\__/ / (_| | |_) | |\ \| __/ | | | (_| | | | | | |  __/
| .__/ \__, \____/ \__,_|_.__/\_| \_\___|_| |_|\__,_|_| |_| |_|\___|
| |     __/ |
|_|    |___/

+------------------------------------------+
| /Bitcoin Donations/:                     |
+------------------------------------------+
| To address:                              |
| 14QFusmzBTAo9FhH7x7puHNkdCps8vamVV       |
+------------------------------------------+
To prevent bad stuff from happening we do not run this script on jobs that areot succesfully completed (par/rar fail)
WzL commented 8 years ago

No it succeeded according to NZBGet logging:

Par: SUCCESS 
Unpack: SUCCESS

I only verified that the script could be run from command line first, then run a test through NZBget. So this test with NZBGet is running at the moment. Exciting times, indeed!

WzL commented 8 years ago

Ahh Success:

Par: SUCCESS 
Unpack: SUCCESS 
pySabRename_nzbget_win: SUCCESS 
Subliminal: none 

Logging:

info    Thu Jun 09 2016 11:37:52    Post-process-script pySabRename_nzbget_win.py for My_All_Wanker_2010_720p_BluRay_x264-DIVULGED_nzb successful
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: New name: /mnt/data/media/completed/Filmpkes/My_All_Wanker_2010_720p_BluRay_x264-DIVULGED_nzb/My_All_Wanker_2010_720p_BluRay_x264-DIVULGED_nzb.mkv
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: Extention supported! .mkv
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: Found extension! (.mkv)
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: Old name: /mnt/data/media/completed/Filmpkes/My_All_Wanker_2010_720p_BluRay_x264-DIVULGED_nzb/My.All.Wanker.2010.720p.BluRay.x264-DiVULGED.mkv
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: Found: My.All.Wanker.2010.720p.BluRay.x264-DiVULGED.mkv
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: +Renaming process+
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: Searching dir: /mnt/data/media/completed/Filmpkes/My_All_Wanker_2010_720p_BluRay_x264-DIVULGED_nzb
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: +------------------------------------------+
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: | 14QFusmzBTAo9FhH7x7puHNkdCps8vamVV |
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: | To address: |
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: +------------------------------------------+
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: | /Bitcoin Donations/: |
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: +------------------------------------------+
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: |_| |___/
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: | | __/ |
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: | .__/ \__, \____/ \__,_|_.__/\_| \_\___|_| |_|\__,_|_| |_| |_|\___|
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: | |_) | |_| /\__/ / (_| | |_) | |\ \| __/ | | | (_| | | | | | | __/
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: | '_ \| | | |`--. \/ _` | '_ \| /| _ \ '_ \ / _` | '_ ` _ \ / _ \
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: _ __ _ _\ `--. __ _| |__ | |_/ /___ _ __ __ _ _ __ ___ ___
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: / ___| | | | ___ \
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: _____ _ ______
info    Thu Jun 09 2016 11:37:52    pySabRename_nzbget_win: pySabRename
info    Thu Jun 09 2016 11:37:52    Executing post-process-script pySabRename_nzbget_win.py for My_All_Wanker_2010_720p_BluRay_x264-DIVULGED_nzb
WzL commented 8 years ago

Ok script runned fine. The above test result was a little bit off because the the parent folder had a trailing "_nzb" in the name. Not sure why. I think script works as expected :+1:

Not sure though what needs to be changed to actually make this script work for others working/running on Linux systems?! Separate download or?

Blauwbek commented 8 years ago

Sorry I forgot about this thread for a bit. I can probably convert the newlines to unix ones, should work on windows as well I suppose