pymedusa / Medusa

Automatic Video Library Manager for TV Shows. It watches for new episodes of your favorite shows, and when they are posted it does its magic.
https://pymedusa.com
GNU General Public License v3.0
1.79k stars 276 forks source link

Missing info hash again #3457

Closed a10kiloham closed 6 years ago

a10kiloham commented 6 years ago

I'm getting this constantly now and can't figure out why. There was an earlier issue #3233 where @fernandog reported this and it seemed fixed, but I'm getting it now on files I've copied over from my remote seedbox as well as some torrents I've downloaded now.


2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] 292638: Saving last subtitles search to database
2017-12-12 20:25:17 INFO     POSTPROCESSOR :: [1a8dc66] 292638: No subtitles found for Acquitted S01E10
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Transaction with 1 queries executed
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] 292638: Setter sets location to /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV.mp4
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Transaction with 1 queries executed
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Checking if /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV.nfo exists: False
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Matched release /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV to a series in your database: Acquitted
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Parsed /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV into format: TV, title: Acquitted, season: 1, episode: [10], episode_title: Truth, type: episode, parsing_time: 0.0561919212341, total_time: 0.0563321113586, absolute_episode: [], quality: Unknown
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Matched release Acquitted S01 E10 (Finale) - Hardcoded Eng Subs - Sno to a series in your database: Acquitted
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Parsed Acquitted S01 E10 (Finale) - Hardcoded Eng Subs - Sno into title: Acquitted, season: 1, episode: [10], episode_title: Hardcoded, subtitle_language: en, release_group: Sno, type: episode, parsing_time: 0.0271091461182, total_time: 0.0272488594055, absolute_episode: [], quality: Unknown
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Found codec for Acquitted Truth
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] 292638: Formatting pattern: %SN - S%0SE%0E - %EN -> Acquitted - S01E10 - Truth
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Metadata provider KODI 12+ creating episode metadata for Acquitted - S01E10 - Truth
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Creating metadata for episode S01E10
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Writing episode nfo file to /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV.nfo
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Setting permissions for /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV.nfo to 438 as parent directory has 511
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Checking if /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV.nfo exists: True
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Checking if /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV.nfo exists: True
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Checking if /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV.nfo exists: True
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] 292638: Saving metadata changes to database
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Matched release /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV to a series in your database: Acquitted
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Parsed /mnt/Resources/TV/Acquitted/Season.01/Acquitted.S01E10.Truth.SDTV into format: TV, title: Acquitted, season: 1, episode: [10], episode_title: Truth, type: episode, parsing_time: 0.056450843811, total_time: 0.0565979480743, absolute_episode: [], quality: Unknown
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Matched release Acquitted S01 E10 (Finale) - Hardcoded Eng Subs - Sno to a series in your database: Acquitted
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Parsed Acquitted S01 E10 (Finale) - Hardcoded Eng Subs - Sno into title: Acquitted, season: 1, episode: [10], episode_title: Hardcoded, subtitle_language: en, release_group: Sno, type: episode, parsing_time: 0.0284559726715, total_time: 0.0286099910736, absolute_episode: [], quality: Unknown
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Found codec for Acquitted Truth
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] 292638: Formatting pattern: %SN - %Sx%0E - %EN - %QN -> Acquitted - 1x10 - Truth - SDTV
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] Notification for NMJ scan update not enabled, skipping this notification
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] GET URL: http://plex:32400/library/sections [Status: 200]
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] User-Agent: Medusa/0.1.20 (Linux; 4.9.44-linuxkit-aufs; d50b6533-dc42-11e7-8342-0242ac110003)
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] PLEX: Updating hosts where TV section paths match the downloaded show: 1
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] GET URL: http://plex:32400/library/sections/1/refresh [Status: 200]
2017-12-12 20:25:17 DEBUG    POSTPROCESSOR :: [1a8dc66] User-Agent: Medusa/0.1.20 (Linux; 4.9.44-linuxkit-aufs; d50b6533-dc42-11e7-8342-0242ac110003)
2017-12-12 20:25:17 WARNING  POSTPROCESSOR :: [1a8dc66] Unable to get info to move torrent later as no info hash available for: /Media/Remote/tv/Acquitted/Acquitted S01 E10 (Finale) - Hardcoded Eng Subs - Sno.mp4
2017-12-12 20:25:17 INFO     POSTPROCESSOR :: [1a8dc66] Processing succeeded for /Media/Remote/tv/Acquitted/Acquitted S01 E10 (Finale) - Hardcoded Eng Subs - Sno.mp4
fernandog commented 6 years ago

I need to check who last changed the code because that PR fixed it. I will check soon and let you know.

That location is the show folder or the download folder?

a10kiloham commented 6 years ago

That location is download folder. Every show is copied to the NAS under /mnt then symlinked

fernandog commented 6 years ago

Can you run git commands?

Run inside Medusa folder:

git revert 088c6eaada435b76127f583c65279413b345ec8c

Restart medusa

a10kiloham commented 6 years ago

I'm using the docker image so don't think git installed. Can try later tho

fernandog commented 6 years ago

Can you edit the medusa *.py files?

fernandog commented 6 years ago

Use this instead of your medusa/post_processor.py:

https://raw.githubusercontent.com/pymedusa/Medusa/364be02d86ea2ae3f887081d4ce23856384efbb9/medusa/post_processor.py

fernandog commented 6 years ago

I will check tomorrow. But it's weird. When it started to happen? Does it happens for all files? All torrents and NZBs?

fernandog commented 6 years ago

@bobbysteel have no clue why its not working anymore. Do you use Jackett ? I will need more info

fernandog commented 6 years ago

Medusa stores info hash from torrent in the Snatch.

Can you open your main.db, history table and filter action column that ends with 02 and check if info hash is available?

Use SQLite DB Browser.

Send a screen shot of latest rows filtered by action ending 02

fernandog commented 6 years ago

@bobbysteel like this:

image

fernandog commented 6 years ago

@bobbysteel tell me the resource name from the last row that has a action ending with 02 and you know file got PPed. I think it's not finding info hash because resource name column (torrent name) is not the same as the torrent name (folder)

fernandog commented 6 years ago

Just tell me the value in the resource name column

a10kiloham commented 6 years ago

ok weirdly i found that particular one that threw an error but it doesn't end in 02 but 04. That resource matching the error above is action 104, resource /Media/Remote/tv/Acquitted/Acquitted S01 E10 (Finale) - Hardcoded Eng Subs - Sno.mp4, info_hash NULL

fernandog commented 6 years ago

@bobbysteel still happening? If yes, can you manually snatch an episode, check in the DB if it has a info_hash in the action column that ends with 02 (snatch). then manually PP only that file and send the logs from the screen please?

a10kiloham commented 6 years ago

Ok I've been able to reproduce. Steps: 1) show is missing episodes, manual search not returning anything 2) I've found a matching torrent on another tracker, so I add the torrent manually 3) post-processing script (nzbToMedia) sends it to Medusa after downloading 4) Medusa throws error Unable to get info to move torrent later as no info hash available for:

It was never snatched as it was a manual add and call to postprocessor by other script. Seems this error should only be called when it's in reference to a torrent that was in fact first snatched.

fernandog commented 6 years ago

That is expected. As I said before the info hash is stored in the Snatch. As you didn't snatch in Medusa, we don't know the info hash

a10kiloham commented 6 years ago

So isn't the warning unnecessary then? I'd expect not to receive a warning in that case as nothing is technically wrong.

fernandog commented 6 years ago

Well, it wasn't a snatch from Medusa, so it can't remove torrent from client. User is warned because torrent won't be removed so he can manually remove it

a10kiloham commented 6 years ago

Wouldn't it be useful to add a check then to see if it was in snatches before warning? I can try and code this myself if that make sense

fernandog commented 6 years ago

i will think about it