Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TorrentToMedia not being called? (now: DS compatibility WIP) #469

Closed
piejanssens opened this issue Jul 9, 2014 · 66 comments
Closed

TorrentToMedia not being called? (now: DS compatibility WIP) #469

piejanssens opened this issue Jul 9, 2014 · 66 comments

Comments

@piejanssens
Copy link

I've set up SR to use torrents for backlog.
Followed the nzbToMedia wiki on how to setup TorrentToMedia.
The torrent is added to transmission, but when the download finishes nothing happens and I don't see any errors or log traces of calling the TorrentToMedia.py script in logs/nzbtomedia.log.

Update: when I stop/start the transmission package (SynoCommunity) the settings.json file is overwritten or at least this part is overwritten:

"script-torrent-done-enabled": true, 
"script-torrent-done-filename": "/volume1/downloads/nzbToMedia/TorrentToMedia.py",
@piejanssens
Copy link
Author

Stop transmission before you change the config, you dumb ass. :)

@clinton-hall
Copy link
Owner

LMAO... I think most of us have been caught by that...

Please feel free to edit the wiki to help prevent others from doing the same...

The hardest thing for me is documenting things that I don't specifically use, or haven't done for a while, or otherwise just take for granted...

@piejanssens
Copy link
Author

It is in the wiki 😄

Make sure you edit while the daemon is not running.

@clinton-hall
Copy link
Owner

Oh... that is priceless 💃
I think this shows that I don't read the wiki either.

Let me know if you run into any issues with this.

@piejanssens
Copy link
Author

Hmm damn, I do have an issue still..
Even now it's in the settings.json correctly, the TorrentToMedia.py script is not called 😠
Don't know what to do next.

@clinton-hall
Copy link
Owner

Are there any transmission logs you can access?

As a guess, if it isn't config, it is likely permissions.

If you did a git clone of these scripts I am guessing you did this via ssh as root.
Transmission probably runs as transmission:users

You can try

cd /volume1/downloads
chown -R transmission:users nzbToMedia

@piejanssens
Copy link
Author

Ah, maybe yes. Remember my other issue this week?
Then we did chown -R nzbget:users nzbToMedia 😄

I don't see any transmission logs btw..

I did this now and will test again:

chgrp -R users nzbToMedia/
chmod -R g+w nzbToMedia/

@clinton-hall
Copy link
Owner

Damn... I'm slow.... Sometimes I don't put posts together...

Ok... So 755 should be fine for transmission:users since the group users has r-x permissions.

Try doing a 777 on autoProcessMedia.cfg and logs/nzbtomedia.log
Both of these are ignored by git update, so you should be safe....

Now, the other likely issue... Transmission is unable to call a python script because the PATH variable used by Transmission spkg on Synology doesn't include the python location???

This can be verified by creating a .sh script that just dumps the environment into a file, and call this from Transmission... But eh... That's when you are desperate.

What I would do is first verify where your python and python2 executables are

which python
which python2

Let us assume they are at /opt/bin for this next step... You can obviously correct this.

What you want to do is edit the script that launches transmission (how do you start/stop via ssh?) this is usually an /etc/init.d/transmission.sh or similar...
If you edit this file, you add the following line just under all of the global definitions...

export PATH=$PATH:/opt/bin

Then restart Transmission.... Now when it goes to launch the script, it should run... But if it can't find Python in the path, it will just print an error to terminal (which isn't monitored) so there will be no logging or anyway to know...

Permissions and Paths.... Almost impossible to figure out with so many different systems and Apps...

@clinton-hall
Copy link
Owner

And if this does indeed work.... This will certainly need to be added to the wiki ;)

@piejanssens
Copy link
Author

Did 777 for both files, now testing again...

I can already say that which pythonand which python2 returns nothing.

/volume1/@appstore/python/bin/python2

@clinton-hall
Copy link
Owner

Wow... So you shouldn't be able to run this script manually???
But that is as root... It might be that your nzbget/SABnzbd downloader does have this path defined.
The other way to do this might be to create a symlink to your python binary

find / -I name python2.7

This will return a full path (e.g /volume1/opt/bin/python2.7)

Create a symlink to somewhere that is in your path (and hopefully is not reset on reboot...)
Try /usr/local/bin

ln -sf /volume1/opt/bin/python2.7 /usr/local/bin/python2
ln -sf /volume1/opt/bin/python2.7 /usr/local/bin/python

Even if that works now, but is reset after a reboot, at least we know what the issue is and we can find the best way to handle this.

@piejanssens
Copy link
Author

I'm using the Syno pkg and I don't see any update for PATH in the transmission package for python.
IMHO it should be in the pyhon package but it's not... https://github.com/SynoCommunity/spksrc/blob/develop/spk/python/src/dsm-control.sh

Your seach query gives this:

/volume1/@appstore/python/bin/python2.7
/volume1/@appstore/python/include/python2.7
/volume1/@appstore/python/lib/python2.7
/volume1/@appstore/couchpotatoserver/env/lib/python2.7
/volume1/@appstore/couchpotatoserver/env/include/python2.7
/volume1/@appstore/couchpotatoserver/env/bin/python2.7
/volume1/@appstore/headphones/env/lib/python2.7
/volume1/@appstore/headphones/env/include/python2.7
/volume1/@appstore/headphones/env/bin/python2.7
/volume1/@appstore/sickbeard-custom/env/lib/python2.7
/volume1/@appstore/sickbeard-custom/env/include/python2.7
/volume1/@appstore/sickbeard-custom/env/bin/python2.7
/volume1/@debian/usr/lib/python2.7

Python is also located in /usr/local/python/bin/python2.7 (I guess that's the same as the first line).

Other packages like CP and SB are setting the PATH variable to include /usr/local/python/bin. I have them running too, so isn't it werid that which pythondoesn't return anything?!

@clinton-hall
Copy link
Owner

Is there also a /usr/local/python/bin/python2 and /usr/local/python/bin/python?

I don't understand Syno packages... But if I am reading correctly you want to change
https://github.com/SynoCommunity/spksrc/blob/develop/spk/transmission/src/dsm-control.sh#L9
To

PATH="${INSTALL_DIR}/bin:/usr/local/python/bin:${PATH}"

@clinton-hall
Copy link
Owner

Ah... There it is... Look at NZBGet
https://github.com/SynoCommunity/spksrc/blob/develop/spk/nzbget/src/dsm-control.sh#L10

That is why NZBGet works and Transmission doesn't

I would suggest reporting this on the Syno repository... Link in the URL to this thread if you want...

@piejanssens
Copy link
Author

Yes there is python, python2 and python2.7.

Yes I was seeing that difference too. But I don't get it, that path variable is per application and not for the system? It would be better if the python package set the PATH variable if that was possible.

@clinton-hall
Copy link
Owner

Exactly... The transmission application uses a path that doesn't find python... So transmission can't run a python script.

You just verified that the default system (root user) path doesn't find python command.

@clinton-hall
Copy link
Owner

Obviously the nzbget app actually specifically sets python into its path (which is what you need Transmission to do).
It would be great to set this into the system path, but my guess is the system path is set in the firmware and is expanded from flash at boot time. So not easy to add to.

@piejanssens
Copy link
Author

That also removes the option of using DS with TorrentToMedia.py I guess, because it is totally the same as transmission under the hood (even setting.json). It was the next thing I was going to try..

@clinton-hall
Copy link
Owner

This will be any easy fix... Just need to find the file...

cd /usr/local/transmission
ls

@piejanssens
Copy link
Author

I mean that DS will not be able to run python..

@clinton-hall
Copy link
Owner

Possibly is you can configure its path...

@piejanssens
Copy link
Author

@clinton-hall
Copy link
Owner

Nice. That should do it...

@piejanssens
Copy link
Author

I think we should use a bash script instead of directly calling TorrentToMedia.py for DownloadStation and set the PATH first. What do you think?

#!/bin/sh

PYTHON_DIR="/usr/local/python"
PATH="${PYTHON_DIR}/bin:${PATH}"
/volume1/downloads/nzbToMedia/TorrentToMedia.py

@piejanssens
Copy link
Author

btw, TorrentToMedia.py works with those changes from the pull request 😉

Just one minor thing:

2014-07-09 15:46:43 INFO    ::COPYLINK: SOURCE FOLDER: [/volume1/downloads/torrent/tv/Banshee S02E10 HDTV x264-KILLERS[ettv]]
2014-07-09 15:46:43 INFO    ::COPYLINK: TARGET FOLDER: [/volume1/downloads/torrent/tv/tv/Banshee S02E10 HDTV x264-KILLERS[ettv]]
2014-07-09 15:46:43 INFO    ::COPYLINK: Moving SOURCE MEDIAFILE -> TARGET FOLDER
2014-07-09 15:46:43 INFO    ::MAIN: FLATTEN: Flattening directory: /volume1/downloads/torrent/tv/tv/Banshee S02E10 HDTV x264-KILLERS[ettv]
2014-07-09 15:46:43 INFO    ::MAIN: Found 1 media files in /volume1/downloads/torrent/tv/tv/Banshee S02E10 HDTV x264-KILLERS[ettv]

Why is it being put in another 'tv' folder? 👅
SR is adding the torrent with that directory '/torrent/tv' so that it's seperated from other '/torrent'.
And what would happen if I download a song/movie/application with transmission because transmission will call 'TorrentToMedia.py' for every torrent?

Note for anyone that wants to try and get this working with DownloadStation:
You need to comment out rm ${PACKAGE_DIR}/etc/download/settings.json in /var/packages/DownloadStation/scripts/start-stop-status.

@clinton-hall
Copy link
Owner

Ok... I'll need to have a look at that remote-cli and see if I can use that to replace the existing RPC client?

Have you verified that the existing script works to connect to transmission (not DS)?

@piejanssens
Copy link
Author

Yes it works for transmission I saw that a torrent got deleted by your script from transmission yesterday.

@piejanssens piejanssens changed the title TorrentToMedia not being called? [transmission pkg] TorrentToMedia not being called? (now: DS compatibility WIP) Jul 11, 2014
@piejanssens
Copy link
Author

Hey @clinton-hall,

I cloned a copy to my MacBook and I'm trying to debug the transmissionrpc from TorrentToMedia with PyCharm IDE. Got a 403 and a clear message that whitelist was turned on and my PC wasn't whitelisted.
I don't know why it didn't work last time though.. maybe I was editing the settings.json while DS was running and it got reset. On my mac I can't use a torrent from DS so if I want to test with DS/tranmission's arguments I need to use nzbToMedia from my Syno...

So anyway it should be able to connect now, I don't see anything about TransmissionRPC in the log anymore. I'll turn on debug log and see what happens.

@piejanssens
Copy link
Author

Giving up.. Connection is fine but TorrentToMedia is never called with any arguments (I guess the arguments are needed to delete the torrent), therefore I called my script with the arguments available by transmission and in the order that TorrentToMedia is expecting it (no category variable available from transmission..):
"script-torrent-done-filename": "/volume1/downloads/execTorrentToMedia.sh $TR_TORRENT_DIR $TR_TORRENT_NAME tv $TR_TORRENT_HASH $TR_TORRENT_ID",

Unfortunately did didn't even execute the bash script.
This is what my bash script looks like:

#bin!/bin/sh

PATH=/usr/local/python/bin:$PATH                            
python /volume1/downloads/nzbToMedia/TorrentToMedia.py $@

@clinton-hall
Copy link
Owner

I wonder is Syno calls these environment variables something different?

If you just call the script as you did previously (from DS without the variables being found) but enable the option

[General]
   log_env = 1

This will dump all environment variables into the log so you can see if the same data is used under a different name...

I wonder if TR_TORRENT_NAME is actually DS_TORRENT_NAME or similar?

@piejanssens
Copy link
Author

2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_APP_VERSION: 2.42
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TORRENT_HASH: 09a948d3ace45ef7979bcdcf1f9d04d39aae9e54
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: PWD: /
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TIME_LOCALTIME: Fri Jul 11 23:15:18 2014
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TORRENT_NAME: Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TORRENT_ID: 973
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: PATH: /usr/local/python/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TORRENT_DIR: /volume1/downloads/torrent/tv

A bit further down I do see that it stops (not remove?) the torrent:
2014-07-11 23:15:28 DEBUG ::MAIN: Stopping torrent Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 in transmission while processing

But in fact the torrent is still in DS.

@clinton-hall
Copy link
Owner

Ok, so it connects fine, but the stop, start, delete calls don't appear to be working...

Have you seen any information to suggest what differences might exist between Transmission and DS?

@clinton-hall
Copy link
Owner

To confirm... The script should stop the torrent while it does e processing... So the stop is at the beginning.

Then it does the linking, extracting' processing an then at the end it should start/resume the torrent for seeding, or delete the torrent and files (if processed successfully and option deleteOriginal is set)

@piejanssens
Copy link
Author

I connected with transmission-remote-cli again and I don't see the torrent in there..
I believe that DS is keeping the torrent or better call it a download task in the list even though it's stopped and removed from the underlying transmission.

@piejanssens
Copy link
Author

deleteOriginal was set to '0', but it did remove the files from my download folder..

@clinton-hall
Copy link
Owner

Can you show the full log from the pp event?

@piejanssens
Copy link
Author

2014-07-11 23:15:24 INFO    ::MAIN: Loading config from [/volume1/downloads/nzbToMedia/autoProcessMedia.cfg]
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_APP_VERSION: 2.42
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TORRENT_HASH: 09a948d3ace45ef7979bcdcf1f9d04d39aae9e54
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: PWD: /
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TIME_LOCALTIME: Fri Jul 11 23:15:18 2014
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TORRENT_NAME: Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TORRENT_ID: 973
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: PATH: /usr/local/python/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/syno/sbin:/usr/syno/bin:/usr/local/sbin:/usr/local/bin
2014-07-11 23:15:24 INFO    ::ENVIRONMENT: TR_TORRENT_DIR: /volume1/downloads/torrent/tv
2014-07-11 23:15:24 INFO    ::MAIN: Checking database structure...
2014-07-11 23:15:24 DEBUG   ::MAIN: Checking Initial Schema database upgrade
2014-07-11 23:15:24 DEBUG   ::MAIN: InitialSchema upgrade not required
2014-07-11 23:15:24 DEBUG   ::MAIN: Checking if we can use git commands: "/usr/local/git/bin/git" version
2014-07-11 23:15:24 DEBUG   ::MAIN: Executing "/usr/local/git/bin/git" version with your shell in /volume1/downloads/nzbToMedia
2014-07-11 23:15:24 DEBUG   ::MAIN: git output: git version 1.8.4
2014-07-11 23:15:24 DEBUG   ::MAIN: "/usr/local/git/bin/git" version : returned successful
2014-07-11 23:15:24 DEBUG   ::MAIN: Using: "/usr/local/git/bin/git"
2014-07-11 23:15:24 DEBUG   ::MAIN: Executing "/usr/local/git/bin/git" symbolic-ref -q HEAD with your shell in /volume1/downloads/nzbToMedia
2014-07-11 23:15:24 DEBUG   ::MAIN: git output: refs/heads/master
2014-07-11 23:15:24 DEBUG   ::MAIN: "/usr/local/git/bin/git" symbolic-ref -q HEAD : returned successful
2014-07-11 23:15:24 INFO    ::MAIN: Checking if git needs an update
2014-07-11 23:15:24 DEBUG   ::MAIN: Executing "/usr/local/git/bin/git" rev-parse HEAD with your shell in /volume1/downloads/nzbToMedia
2014-07-11 23:15:24 DEBUG   ::MAIN: git output: 7ac3d510a299552fc05a3851f2bd58f2e4efdc12
2014-07-11 23:15:24 DEBUG   ::MAIN: "/usr/local/git/bin/git" rev-parse HEAD : returned successful
2014-07-11 23:15:24 DEBUG   ::MAIN: Executing "/usr/local/git/bin/git" fetch origin with your shell in /volume1/downloads/nzbToMedia
2014-07-11 23:15:27 DEBUG   ::MAIN: git output: From https://github.com/clinton-hall/nzbToMedia
   37cc367..85afe09  nightly    -> origin/nightly
2014-07-11 23:15:27 DEBUG   ::MAIN: "/usr/local/git/bin/git" fetch origin : returned successful
2014-07-11 23:15:27 DEBUG   ::MAIN: Executing "/usr/local/git/bin/git" rev-parse --verify --quiet "@{upstream}" with your shell in /volume1/downloads/nzbToMedia
2014-07-11 23:15:28 DEBUG   ::MAIN: git output: 7ac3d510a299552fc05a3851f2bd58f2e4efdc12
2014-07-11 23:15:28 DEBUG   ::MAIN: "/usr/local/git/bin/git" rev-parse --verify --quiet "@{upstream}" : returned successful
2014-07-11 23:15:28 DEBUG   ::MAIN: Executing "/usr/local/git/bin/git" rev-list --left-right "@{upstream}"...HEAD with your shell in /volume1/downloads/nzbToMedia
2014-07-11 23:15:28 DEBUG   ::MAIN: git output: 
2014-07-11 23:15:28 DEBUG   ::MAIN: "/usr/local/git/bin/git" rev-list --left-right "@{upstream}"...HEAD : returned successful
2014-07-11 23:15:28 DEBUG   ::MAIN: cur_commit = 7ac3d510a299552fc05a3851f2bd58f2e4efdc12 % (newest_commit)= 7ac3d510a299552fc05a3851f2bd58f2e4efdc12, num_commits_behind = 0, num_commits_ahead = 0
2014-07-11 23:15:28 INFO    ::MAIN: No update needed
2014-07-11 23:15:28 INFO    ::MAIN: nzbToMedia Version:7ac3d510a299552fc05a3851f2bd58f2e4efdc12 Branch:master (Linux 2.6.32.12)
2014-07-11 23:15:28 DEBUG   ::MAIN: Connecting to transmission: http://localhost:9093
2014-07-11 23:15:28 INFO    ::MAIN: #########################################################
2014-07-11 23:15:28 INFO    ::MAIN: ## ..::[TorrentToMedia.py]::.. ##
2014-07-11 23:15:28 INFO    ::MAIN: #########################################################
2014-07-11 23:15:28 DEBUG   ::MAIN: Options passed into TorrentToMedia: ['/volume1/downloads/nzbToMedia/TorrentToMedia.py']
2014-07-11 23:15:28 DEBUG   ::MAIN: Adding TORRENT download info for directory /volume1/downloads/torrent/tv to database
2014-07-11 23:15:28 DEBUG   ::MAIN: Received Directory: /volume1/downloads/torrent/tv | Name: Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 | Category: 
2014-07-11 23:15:28 DEBUG   ::MAIN: SEARCH: Found Category: tv in directory structure
2014-07-11 23:15:28 INFO    ::MAIN: SEARCH: Found torrent file Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 in input directory directory /volume1/downloads/torrent/tv
2014-07-11 23:15:28 INFO    ::MAIN: SEARCH: Setting inputDirectory to /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:28 DEBUG   ::MAIN: Determined Directory: /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 | Name: Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 | Category: tv
2014-07-11 23:15:28 INFO    ::MAIN: Auto-detected SECTION:SickBeard
2014-07-11 23:15:28 DEBUG   ::MAIN: Stopping torrent Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 in transmission while processing
2014-07-11 23:15:33 INFO    ::MAIN: Output directory set to: /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:33 DEBUG   ::MAIN: Scanning files in directory: /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:34 DEBUG   ::MAIN: Found 1 files in /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:34 INFO    ::COPYLINK: MEDIAFILE: [Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4]
2014-07-11 23:15:34 INFO    ::COPYLINK: SOURCE FOLDER: [/volume1/downloads/torrent/tv]
2014-07-11 23:15:34 INFO    ::COPYLINK: TARGET FOLDER: [/volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4]
2014-07-11 23:15:34 INFO    ::COPYLINK: SOURCE AND TARGET folders are the same, skipping ...
2014-07-11 23:15:34 DEBUG   ::MAIN: Checking for archives to extract in directory: /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:34 INFO    ::MAIN: FLATTEN: Flattening directory: /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:34 ERROR   ::FLATTEN: Could not flatten /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:34 INFO    ::MAIN: Found 1 media files in /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:34 INFO    ::MAIN: Calling SickBeard:tv to post-process:Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:15:34 INFO    ::MAIN: Attempting to auto-detect tv fork
2014-07-11 23:15:34 INFO    ::MAIN: SickBeard:tv fork auto-detection successful ...
2014-07-11 23:15:34 INFO    ::MAIN: SickBeard:tv fork set to failed-torrent
2014-07-11 23:15:34 POSTPROCESS::SICKBEARD: SUCCESS: The download succeeded, sending a post-process request
2014-07-11 23:15:34 DEBUG   ::SICKBEARD: Opening URL: http://localhost:8081/home/postprocess/processEpisode
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Processing folder /volume1/downloads/torrent/tv
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: TV_DOWNLOAD_DIR: 
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: PostProcessing Path: /volume1/downloads/torrent
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: PostProcessing Dirs: []
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: PostProcessing Files: [u'/volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4']
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: PostProcessing VideoFiles: [u'/volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4']
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: PostProcessing RarContent: []
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: PostProcessing VideoInRar: []
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Processing /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 (Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4)
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Found result in history: (<sickbeard.tv.TVShow object at 0x11488db0>, 2, [], 1)
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Retrieving episode object for 2x10
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Snatch history had a quality in it, using that: SD TV
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: SB snatched this episode so I'm marking it as priority
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Is ep a priority download: True
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: File /volume1/TV/Banshee/Season 02/Banshee.S02E10.SD.TV.Bullets and Tears.mp4 doesn't exist so there's no worries about replacing it
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: This download is marked a priority download so I'm going to replace an existing file if I find one
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Found release name Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Destination folder for this episode: /volume1/TV/Banshee/Season 02
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Moving file from /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 to /volume1/TV/Banshee/Season 02/Banshee.S02E10.SD.TV.Bullets and Tears.mp4
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Processing succeeded for /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4
2014-07-11 23:16:39 POSTPROCESS::SICKBEARD: Problem(s) during processing
2014-07-11 23:16:39 DEBUG   ::MAIN: Deleting torrent Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 from transmission
2014-07-11 23:16:44 INFO    ::CLEANDIR: Directory /volume1/downloads/torrent/tv/Banshee.S02E10.HDTV.x264-KILLERS.[VTV].mp4 has been processed and removed ...
2014-07-11 23:16:44 INFO    ::MAIN: The /volume1/downloads/nzbToMedia/TorrentToMedia.py script completed successfully.

@clinton-hall
Copy link
Owner

ok... I think the issue here is that the outputDirectory is the same as the inputDirectory.

::COPYLINK: SOURCE AND TARGET folders are the same, skipping ...

so when SR processes these files, it actually moves the files away so DS can't find the files anymore.

I wonder if this would work if you used?

[Torrent]
    outputDirectory = /volume1/downloads/torrent/processed
    useLink = hard
    deleteOriginal = 1

@piejanssens
Copy link
Author

@clinton-hall I'm going to leave it as it is for now, it works good. PP works, files are deleted from download folder + removed from transmission.

@clinton-hall
Copy link
Owner

no worries... thanks for all your help.

If you find anything that needs changing at my end, please shout out.

@piejanssens
Copy link
Author

Thank you too for the assistance.

Cross platform cue splitting for different formats for nzbToHeadphones would be a nice addition 😝

@clinton-hall
Copy link
Owner

ok... break that down for me is easy to understand terms...

@piejanssens
Copy link
Author

Often an album is released with just one audio file and a CUE sheet.
HeadPhones will fail to process this album because it's expecting x number of tracks and in addition it will parse every filename to match with a track on the album. But if you have only one audio file it will have the name of the album and nothing else..

The cue sheet contains all information (artist,track,pause,title,album,..) to split this one audio file into separate files. This can be done without re-encoding..

So before letting HP know that it can pp the album, split the audio file into separate tracks.
The audio file always has the same name as the cue file.

If there are multiple discs, either they are in two separate subdirectories (like "disc 01" and "disc 02") or the filename of the cue and audio files will indicate which disc it is.

mp3splt seems to work on every platform (Windows, Linux, OS X) and supports FLAC, MP3 and OGG Vorbis as formats.

http://sourceforge.net/projects/mp3splt/

@Madseason41
Copy link

Transmission no longer calls the TorrentToMedia script for me as well. I just performed a git pull to resolve a headphones post processing issue. The script ran fine until I performed the update. I am on the master branch. I am on running a QNAP 219. When I ssh into the QNAP and perform cd /share/HDA_DATA/.qpkg/nzbToMedia/ then run python TorrentToMedia.py the script runs fine. Was this broke with the update mentioned above?

@clinton-hall
Copy link
Owner

The issue is that the scripts now call python2
on qnap, do the following via ssh
ln -sf /opt/bin/python2.7 /opt/bin/python2

@Madseason41
Copy link

Unfortunately this did not work.

Sent from my iPad

On Jul 22, 2014, at 9:12 PM, Clinton Hall notifications@github.com wrote:

The issue is that the scripts now call python2
on qnap, do the following via ssh
ln -sf /opt/bin/python2.7 /opt/bin/python2


Reply to this email directly or view it on GitHub.

@clinton-hall
Copy link
Owner

Ah... I think the issue is with the transmission script in QNAP

Can you verify that typing /opt/bin/python2 works now?
if so, exit by typing 'exit()`

Then you need to edit /etc/init.d/transmission.sh

add the following at aboput line 20 (just above the export LD_LIBRARY_PATH line)
export PATH=$PATH:/opt/bin

then restart Transmission. /etc/init.d/transmission.sh

@Madseason41
Copy link

That worked. Now will that transmission script change survive a qpkg update?

Sent from my iPhone

On Jul 22, 2014, at 11:25 PM, Clinton Hall notifications@github.com wrote:

Ah... I think the issue is with the transmission script in QNAP

Can you verify that typing /opt/bin/python2 works now?
if so, exit by typing 'exit()`

Then you need to edit /etc/init.d/transmission.sh

add the following at aboput line 20 (just above the export LD_LIBRARY_PATH line)
export PATH=$PATH:/opt/bin

then restart Transmission. /etc/init.d/transmission.sh


Reply to this email directly or view it on GitHub.

@clinton-hall
Copy link
Owner

It will survive FW update and restart... But a transmission qpkg update will break this.
It is worth asking the transmission qpkg maintainer to include this in next update...

@Danikool
Copy link

Hello,

After hours and hours, I managed to make TorrentToMedia work with Transmission. But I can't make it work it work with Download Station, even though I religiously followed the wiki how-to.

I get a "failed to connect to transmission".

I tried without password, with password, assigning a port to DS. Nothing seems to work.

So I wonder, is the wiki still up-to-date and I'm doing something wrong, or has something change with the recent DS updates ?

@piejanssens : is TorrentToMedia still working with DS for you ?

@piejanssens
Copy link
Author

Just stick to Transmission. I gave up on DS because it shuts down the service when the queue is idle.

@Danikool
Copy link

Ok thanks. Good to know. Nevertheless, do you know if TorrentToMedia can still connect to DS like you used to (using the transmission setting with port 9093) ?

@MrCee
Copy link

MrCee commented Nov 30, 2015

Yes it does, but so far I have not been able to get further scripts invoked. This used to work. I have raised this with Synology. I also have needed to move away from Download Station to Transmission just to get TorrentToMedia.py to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants