mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
autoProcessMovie now searches for snatched download via imdbid, download_id and torrent hash using torrent api calls.
This commit is contained in:
parent
1e90193f47
commit
6c3096851b
3 changed files with 92 additions and 80 deletions
|
@ -10,6 +10,10 @@ import nzbtomedia
|
|||
|
||||
from nzbtomedia.linktastic import linktastic
|
||||
from nzbtomedia import logger
|
||||
from nzbtomedia.synchronousdeluge.client import DelugeClient
|
||||
from nzbtomedia.utorrent.client import UTorrentClient
|
||||
from nzbtomedia.transmissionrpc.client import Client as TransmissionClient
|
||||
|
||||
|
||||
def getDirectorySize(directory):
|
||||
dir_size = 0
|
||||
|
@ -442,4 +446,35 @@ def cleanup_directories(inputCategory, processCategories, result, directory):
|
|||
else:
|
||||
logger.info("Directory %s still contains %s media and/or meta files. This directory will not be removed.", directory, num_files_new)
|
||||
for item in file_list:
|
||||
logger.debug("media/meta file found: %s", item)
|
||||
logger.debug("media/meta file found: %s", item)
|
||||
|
||||
def create_torrent_class(clientAgent):
|
||||
# Hardlink solution for Torrents
|
||||
TorrentClass = ""
|
||||
if clientAgent in ['utorrent', 'transmission', 'deluge']:
|
||||
if clientAgent == 'utorrent':
|
||||
try:
|
||||
logger.debug("Connecting to %s: %s", clientAgent, nzbtomedia.UTORRENTWEBUI)
|
||||
TorrentClass = UTorrentClient(nzbtomedia.UTORRENTWEBUI, nzbtomedia.UTORRENTUSR, nzbtomedia.UTORRENTPWD)
|
||||
except:
|
||||
logger.error("Failed to connect to uTorrent")
|
||||
|
||||
if clientAgent == 'transmission':
|
||||
try:
|
||||
logger.debug("Connecting to %s: http://%s:%s", clientAgent, nzbtomedia.TRANSMISSIONHOST,
|
||||
nzbtomedia.TRANSMISSIONPORT)
|
||||
TorrentClass = TransmissionClient(nzbtomedia.TRANSMISSIONHOST, nzbtomedia.TRANSMISSIONPORT, nzbtomedia.TRANSMISSIONUSR,
|
||||
nzbtomedia.TRANSMISSIONPWD)
|
||||
except:
|
||||
logger.error("Failed to connect to Transmission")
|
||||
|
||||
if clientAgent == 'deluge':
|
||||
try:
|
||||
logger.debug("Connecting to %s: http://%s:%s", clientAgent, nzbtomedia.DELUGEHOST,
|
||||
nzbtomedia.DELUGEPORT)
|
||||
TorrentClass = DelugeClient()
|
||||
TorrentClass.connect(host =nzbtomedia.DELUGEHOST, port =nzbtomedia.DELUGEPORT, username =nzbtomedia.DELUGEUSR, password =nzbtomedia.DELUGEPWD)
|
||||
except:
|
||||
logger.error("Failed to connect to deluge")
|
||||
|
||||
return TorrentClass
|
Loading…
Add table
Add a link
Reference in a new issue