clinton-hall / nzbToMedia

Provides NZB and Torrent postprocessing To CouchPotatoServer, SickBeard/SickRage, HeadPhones, Mylar and Gamez
GNU General Public License v3.0
670 stars 176 forks source link

Torrent, CouchPotato, CleanUp and Transmission #196

Closed Jorman closed 10 years ago

Jorman commented 10 years ago

Ok, I don't remember that I've changed my configuration since last time, so, this time I don't know why for this error, seems that cp changed something, so this's the TorrentToMedia log, followed by the CP log:

07:08:21|INFO TorrentToMedia V8.6 07:08:21|INFO MAIN: Loading config from /home/xbmc/scripts/nzbToMedia/autoProcessMedia.cfg 07:08:21|DEBUG arg 0 is: /home/xbmc/scripts/nzbToMedia/TorrentToMedia.py 07:08:21|DEBUG MAIN: Received Directory: /media/TwoTera/Download/torrent/film | Name: Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM | Category: 07:08:21|DEBUG SEARCH: Found Category: film in directory structure 07:08:21|INFO SEARCH: Determined Category to be: film 07:08:21|INFO SEARCH: Found torrent directory /media/TwoTera/Download/torrent/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM in category directory /media/TwoTera/Download/torrent/film 07:08:21|INFO MAIN: Download is a directory 07:08:21|DEBUG MAIN: Scanning files in directory: /media/TwoTera/Download/torrent/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM 07:08:21|INFO MAIN: Found metadata file .nfo for file /media/TwoTera/Download/torrent/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM.nfo 07:08:21|INFO CREATE DESTINATION: Creating destination folder: /media/TwoTera/Download/torrent/tmp/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM 07:08:22|DEBUG Moving /media/TwoTera/Download/torrent/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM.nfo to /media/TwoTera/Download/torrent/tmp/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM.nfo 07:08:22|DEBUG MAIN: Ignoring unknown filetype .txt for file /media/TwoTera/Download/torrent/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM/TrTd_TeaM.info.txt 07:08:22|INFO MAIN: Found video file .mkv in /media/TwoTera/Download/torrent/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM.mkv 07:08:22|DEBUG Moving /media/TwoTera/Download/torrent/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM.mkv to /media/TwoTera/Download/torrent/tmp/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM.mkv 07:08:22|INFO FLATTEN: Flattening directory: /media/TwoTera/Download/torrent/tmp/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM 07:08:22|INFO REMOVER: Removing empty folders in: /media/TwoTera/Download/torrent/tmp/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM 07:08:22|DEBUG MAIN: Connecting to transmission: http://localhost:9091 07:08:22|DEBUG MAIN: Stoping torrent Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM in transmission while processing 07:08:27|DEBUG MAIN: Calling autoProcess script for successful download. 07:08:27|INFO MAIN: Calling CouchPotatoServer to post-process: Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM 07:08:27|INFO Loading config from /home/xbmc/scripts/nzbToMedia/autoProcessMedia.cfg 07:08:27|WARNING Could not find an imdb id in directory or name 07:08:27|INFO Postprocessing will continue, but the movie may not be identified correctly by CouchPotato 07:08:27|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.list/?status=active 07:08:27|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=80 07:08:27|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=27 07:08:27|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=15 07:08:27|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=157 07:08:27|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=14 07:08:27|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=16 07:08:28|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=154 07:08:28|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=156 07:08:28|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=114 07:08:28|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=66 07:08:28|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=155 07:08:28|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=67 07:08:28|INFO Found movie id 67 in database via download_id 4506357befc5ab53edba9838b3a925cdeb841596 07:08:28|DEBUG Looking for status of movie: 67 - with release sent to clientAgent: transmission and download_id: 4506357befc5ab53edba9838b3a925cdeb841596 07:08:28|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=67 07:08:28|DEBUG This movie is marked as status active in CouchPotatoServer 07:08:28|DEBUG Found a single release with download_id: 4506357befc5ab53edba9838b3a925cdeb841596 for clientAgent: Transmission. Release status is: snatched 07:08:28|INFO Waiting for 65.0 seconds to allow CPS to process newly extracted files 07:09:33|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/renamer.scan/?movie_folder=/media/TwoTera/Download/torrent/tmp/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM&downloader=Transmission&download_id=4506357befc5ab53edba9838b3a925cdeb841596 07:09:34|INFO CouchPotatoServer returned {u'success': True} 07:09:34|INFO renamer scan started on CouchPotatoServer for Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM 07:09:34|DEBUG Looking for status of movie: 67 - with release sent to clientAgent: Transmission and download_id: 4506357befc5ab53edba9838b3a925cdeb841596 07:09:34|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=67 07:09:34|DEBUG This movie is marked as status active in CouchPotatoServer 07:09:34|DEBUG Found a single release with download_id: 4506357befc5ab53edba9838b3a925cdeb841596 for clientAgent: Transmission. Release status is: snatched 07:09:54|DEBUG Looking for status of movie: 67 - with release sent to clientAgent: Transmission and download_id: 4506357befc5ab53edba9838b3a925cdeb841596 07:09:54|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=67 07:09:54|DEBUG This movie is marked as status active in CouchPotatoServer 07:09:54|DEBUG Found a single release with download_id: 4506357befc5ab53edba9838b3a925cdeb841596 for clientAgent: Transmission. Release status is: snatched 07:10:14|DEBUG Looking for status of movie: 67 - with release sent to clientAgent: Transmission and download_id: 4506357befc5ab53edba9838b3a925cdeb841596 07:10:14|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=67 07:10:14|DEBUG This movie is marked as status active in CouchPotatoServer 07:10:14|DEBUG Found a single release with download_id: 4506357befc5ab53edba9838b3a925cdeb841596 for clientAgent: Transmission. Release status is: snatched 07:10:34|DEBUG Looking for status of movie: 67 - with release sent to clientAgent: Transmission and download_id: 4506357befc5ab53edba9838b3a925cdeb841596 07:10:34|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=67 07:10:34|DEBUG This movie is marked as status active in CouchPotatoServer 07:10:34|DEBUG Found a single release with download_id: 4506357befc5ab53edba9838b3a925cdeb841596 for clientAgent: Transmission. Release status is: snatched 07:10:54|DEBUG Looking for status of movie: 67 - with release sent to clientAgent: Transmission and download_id: 4506357befc5ab53edba9838b3a925cdeb841596 07:10:54|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=67 07:10:54|DEBUG This movie is marked as status active in CouchPotatoServer 07:10:54|DEBUG Found a single release with download_id: 4506357befc5ab53edba9838b3a925cdeb841596 for clientAgent: Transmission. Release status is: snatched 07:11:14|DEBUG Looking for status of movie: 67 - with release sent to clientAgent: Transmission and download_id: 4506357befc5ab53edba9838b3a925cdeb841596 07:11:14|DEBUG Opening URL: http://localhost:5050/api/28ceb7bbfab54dd6854d19b5d6e7d442/movie.get/?id=67 07:11:14|DEBUG This movie is marked as status active in CouchPotatoServer 07:11:14|DEBUG Found a single release with download_id: 4506357befc5ab53edba9838b3a925cdeb841596 for clientAgent: Transmission. Release status is: snatched 07:11:34|WARNING The movie does not appear to have changed status after 2 minutes. Please check CouchPotato Logs 07:11:34|INFO MAIN: A problem was reported in the autoProcess* script. If torrent was pasued we will resume seeding 07:11:34|INFO MAIN: All done.

CP 10-29 07:09:34 INFO [tato.core.plugins.renamer] Scanning movie folder /media/TwoTera/Download/torrent/tmp/film/Gli.Stagisti.The.Internship.2013.UNRATED.iTALiAN.1080p.DUAL.BrRiP.x264-TrTd_TeaM...10-29 07:09:34 ERROR [ couchpotato.core.event] Error in event "renamer.scan", that wasn't caught: Traceback (most recent call last): File "/home/xbmc/.couchpotato/couchpotato/core/event.py", line 12, in runHandler return handler(_args, *_kwargs) File "/home/xbmc/.couchpotato/couchpotato/core/plugins/renamer/main.py", line 139, in scan if release_download['files']: KeyError: 'files' encoding=UTF-8 debug=False args=['--daemon', '--pid_file=/var/run/couchpotato.pid'] app_dir=/home/xbmc/.couchpotato data_dir=/home/xbmc/.couchpotato desktop=None options=Namespace(config_file='/home/xbmc/.couchpotato/settings.conf', console_log=False, daemon=True, data_dir=None, debug=False, pid_file='/var/run/couchpotato.pid', quiet=False)

So, the torrent was paused but cannot be resumed because the file is still in the tmp directory, and I don't know if the script deleted some file like txt or others. For the cleaning up phase I see that, in download directory I've many old dirs, so sometime the script don't delete the dirs :)

J

clinton-hall commented 10 years ago

This is a recent bug introduced in CouchPotato. When the renamer is triggered via Api (e.g this script) it gives an error as a ye isn't created correctly.

This has been fixed in develop. So you can switch to CouchPotato develop branch or wait for the next update (hopefully won't be too long).

Jorman commented 10 years ago

dev-TPB or normal dev? I'm on a dev

clinton-hall commented 10 years ago

The same is true for master, dev, and dev-TPB on this repo.... You need to switch to CouchPotato's develop branch as this bug was introduced in CouchPotato and there is no Api call that I can pass to work with the master branch of CouchPotato.

Sorry for not making that clearer in the first post... I only close issues here if there is nothing I can do ;)

Jorman commented 10 years ago

I'm sorry I misunderstood :) tnx again.

What about the cleaning phase and the resuming torrent?

clinton-hall commented 10 years ago

Ok... Sorry, but I hadn't noticed those extra comments....

Basically this script shouldn't have deleted any of the original files and these can be resumed to seeding (are you saying this didn't happen?)

The old directories, are these all empty? What should happen here is that CouchPotato and SickBeard etc should delete the directories! but if any files are left over this doesn't happen...

clinton-hall commented 10 years ago

What I might do is add a check to see if all media files are removed.... If so, delete the temp folder.

clinton-hall commented 10 years ago

ok... I have added in a cleanup where the output destination is deleted if the postprocess was successful and there are no Media and Meta files left... so if there are some other leftover files (that stop CouchPotato and SickBeard from deleting the directory), the directory will be deleted...

Jorman commented 10 years ago

ok, I'll try