IMP: Added 'Force to TPB/GN' option for printed editions and 'Force to Print' option for TPB/GN's (this WILL impact how files are scanned in - so make sure you have files named appropriately), IMP: Added One-Shot as a Type, FIX: Fixed incorrect variable reference to seriesvolume during post-processing of TPB series, FIX: Fixed refresh to fire off every 5 minutes, FIX: When post-processing and metatagging a cbz file with rename files not enabled, would indicate the new filename as being a copy of the existing file (ie. (1).cbz) which would carry over to a final filename, IMP: Allow Mylar to populate the alias list on add/refresh of a series if the aliases don't already exist in the Alternate Series field for the series, FIX: Fixed a problem with single quotes in series titles when using experimental search,
IMP: When searching for a one-off series, will accept either issues with an issue number or those with no issue numbers as acceptable search results when searching, IMP: Updated search code to utilize the existing filename parser within Mylar when parsing the search results for more consistency
2018-12-22 22:48:14 +00:00
# This file is part of Mylar.
#
# Mylar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mylar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Mylar. If not, see <http://www.gnu.org/licenses/>.
2013-07-30 04:57:37 +00:00
import os , sys
import re
2016-09-07 04:04:42 +00:00
import feedparser
import requests
import cfscrape
2016-08-20 21:56:30 +00:00
import urlparse
2013-07-30 04:57:37 +00:00
import ftpsshup
2017-06-29 17:50:00 +00:00
from datetime import datetime , timedelta
2013-09-05 02:36:41 +00:00
import gzip
2016-05-06 17:31:46 +00:00
import time
2017-03-15 17:19:19 +00:00
import random
2019-03-08 21:56:05 +00:00
from bs4 import BeautifulSoup
2013-09-05 02:36:41 +00:00
from StringIO import StringIO
2013-07-30 04:57:37 +00:00
import mylar
FIX: if 32p was disabled due to inability to signon, would still attempt to retrieve cached result when match occured which would then possibly result in excessive attempted logins, IMP: Added Force Type option to comicdetails page which will allow the type of series to be forced to TPB/GN format if Mylar is unable to decipher it under normal circumstances (doing this will affect how files are parsed for the given series), IMP: TPB/GN File Parser will now account for mutiple issues of the same TPB series within the given directory, IMP: When enabling/disabling Force Type, will rename existing folder to accomodate new naming folder convention if required, IMP: Started to move some of the file rename/manipulation modules into a filer.py module for more consistency, IMP: Added a to Folder Format which when triggered will use the designated Series Type, IMP:(#2130) When importing, option now available for the final series destination path to use the imported path location instead of defaulting to the Comic Location base folder - status will be no longer be Archived in such cases. Will also not show previous imported series on subsequent import runs if the import directory has not changed (thnx @CuddleBear92), IMP: Added the codebase for a Rename Preview option into the mix - GUI available, but not linked, FIX: Removed DEM from RSS scans when Public Torrents option is enabled, FIX:(#2137) When adding series, if series indicated date in a different format other than just numeric, would cause error
2018-12-10 17:27:53 +00:00
from mylar import db , logger , ftpsshup , helpers , auth32p , utorrent , helpers
2016-09-07 04:04:42 +00:00
import torrent . clients . transmission as transmission
2016-12-17 14:24:12 +00:00
import torrent . clients . deluge as deluge
2017-04-28 06:12:45 +00:00
import torrent . clients . qbittorrent as qbittorrent
2015-04-17 17:29:30 +00:00
2015-03-20 06:47:43 +00:00
def _start_newznab_attr ( self , attrsD ) :
context = self . _getContext ( )
context . setdefault ( ' newznab ' , feedparser . FeedParserDict ( ) )
context [ ' newznab ' ] . setdefault ( ' tags ' , feedparser . FeedParserDict ( ) )
name = attrsD . get ( ' name ' )
value = attrsD . get ( ' value ' )
if name == ' category ' :
context [ ' newznab ' ] . setdefault ( ' categories ' , [ ] ) . append ( value )
else :
context [ ' newznab ' ] [ name ] = value
feedparser . _FeedParserMixin . _start_newznab_attr = _start_newznab_attr
2015-05-22 08:32:51 +00:00
def torrents ( pickfeed = None , seriesname = None , issue = None , feedinfo = None ) :
2013-07-30 04:57:37 +00:00
if pickfeed is None :
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
return
2013-08-07 06:27:12 +00:00
srchterm = None
if seriesname :
srchterm = re . sub ( ' ' , ' % 20 ' , seriesname )
if issue :
2013-10-19 01:04:16 +00:00
srchterm + = ' % 20 ' + str ( issue )
2016-08-20 21:56:30 +00:00
#this is for the public trackers included thus far in order to properly cycle throught the correct ones depending on the search request
# DEM = rss feed
# WWT = rss feed
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
#if pickfeed == 'TPSE-SEARCH':
# pickfeed = '2'
# loopit = 1
loopit = 1
2018-12-04 19:34:10 +00:00
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
if pickfeed == ' Public ' :
2018-12-04 19:34:10 +00:00
pickfeed = ' 999 '
# since DEM is dead, just remove the loop entirely
# #we need to cycle through both DEM + WWT feeds
# loopit = 2
2014-04-14 17:59:27 +00:00
lp = 0
2014-09-05 06:19:26 +00:00
totalcount = 0
2013-09-05 02:36:41 +00:00
2013-07-30 04:57:37 +00:00
title = [ ]
link = [ ]
description = [ ]
seriestitle = [ ]
feeddata = [ ]
myDB = db . DBConnection ( )
2016-08-20 21:56:30 +00:00
torthetpse = [ ]
2015-08-11 21:56:22 +00:00
torthe32p = [ ]
torinfo = { }
2013-07-30 04:57:37 +00:00
2014-04-14 17:59:27 +00:00
while ( lp < loopit ) :
2015-05-22 08:32:51 +00:00
if lp == 0 and loopit == 2 :
2016-08-20 21:56:30 +00:00
pickfeed = ' 6 ' #DEM RSS
2015-05-22 08:32:51 +00:00
elif lp == 1 and loopit == 2 :
2016-08-20 21:56:30 +00:00
pickfeed = ' 999 ' #WWT RSS
2017-09-06 01:27:54 +00:00
2014-04-14 17:59:27 +00:00
feedtype = None
FIX: if 32p was disabled due to inability to signon, would still attempt to retrieve cached result when match occured which would then possibly result in excessive attempted logins, IMP: Added Force Type option to comicdetails page which will allow the type of series to be forced to TPB/GN format if Mylar is unable to decipher it under normal circumstances (doing this will affect how files are parsed for the given series), IMP: TPB/GN File Parser will now account for mutiple issues of the same TPB series within the given directory, IMP: When enabling/disabling Force Type, will rename existing folder to accomodate new naming folder convention if required, IMP: Started to move some of the file rename/manipulation modules into a filer.py module for more consistency, IMP: Added a to Folder Format which when triggered will use the designated Series Type, IMP:(#2130) When importing, option now available for the final series destination path to use the imported path location instead of defaulting to the Comic Location base folder - status will be no longer be Archived in such cases. Will also not show previous imported series on subsequent import runs if the import directory has not changed (thnx @CuddleBear92), IMP: Added the codebase for a Rename Preview option into the mix - GUI available, but not linked, FIX: Removed DEM from RSS scans when Public Torrents option is enabled, FIX:(#2137) When adding series, if series indicated date in a different format other than just numeric, would cause error
2018-12-10 17:27:53 +00:00
if pickfeed == " 1 " and mylar . CONFIG . ENABLE_32P is True : # 32pages new releases feed.
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
feed = ' https://32pag.es/feeds.php?feed=torrents_all&user= ' + feedinfo [ ' user ' ] + ' &auth= ' + feedinfo [ ' auth ' ] + ' &passkey= ' + feedinfo [ ' passkey ' ] + ' &authkey= ' + feedinfo [ ' authkey ' ]
2014-04-14 17:59:27 +00:00
feedtype = ' from the New Releases RSS Feed for comics '
2017-10-25 18:33:56 +00:00
verify = bool ( mylar . CONFIG . VERIFY_32P )
2016-08-20 21:56:30 +00:00
elif pickfeed == " 2 " and srchterm is not None : # TP.SE search / RSS
2017-11-16 16:22:46 +00:00
lp + = 1
continue
#feed = tpse_url + 'rss/' + str(srchterm) + '/'
#verify = bool(mylar.CONFIG.TPSE_VERIFY)
2016-08-20 21:56:30 +00:00
elif pickfeed == " 3 " : # TP.SE rss feed (3101 = comics category) / non-RSS
2017-11-16 16:22:46 +00:00
lp + = 1
continue
#feed = tpse_url + '?hl=en&safe=off&num=50&start=0&orderby=best&s=&filter=3101'
#feedtype = ' from the New Releases RSS Feed for comics from TP.SE'
#verify = bool(mylar.CONFIG.TPSE_VERIFY)
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
elif pickfeed == " 4 " : #32p search
2017-10-25 18:33:56 +00:00
if any ( [ mylar . CONFIG . USERNAME_32P is None , mylar . CONFIG . USERNAME_32P == ' ' , mylar . CONFIG . PASSWORD_32P is None , mylar . CONFIG . PASSWORD_32P == ' ' ] ) :
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
logger . error ( ' [RSS] Warning - you NEED to enter in your 32P Username and Password to use this option. ' )
lp = + 1
continue
2019-02-21 16:40:21 +00:00
if mylar . CONFIG . MODE_32P is False :
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
logger . warn ( ' [32P] Searching is not available in 32p Legacy mode. Switch to Auth mode to use the search functionality. ' )
lp = + 1
continue
return
2016-08-20 21:56:30 +00:00
elif pickfeed == " 5 " and srchterm is not None : # demonoid search / non-RSS
2017-09-06 01:27:54 +00:00
feed = mylar . DEMURL + " files/?category=10&subcategory=All&language=0&seeded=2&external=2&query= " + str ( srchterm ) + " &uid=0&out=rss "
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
verify = bool ( mylar . CONFIG . PUBLIC_VERIFY )
2016-08-20 21:56:30 +00:00
elif pickfeed == " 6 " : # demonoid rss feed
2017-09-06 01:27:54 +00:00
feed = mylar . DEMURL + ' rss/10.xml '
2016-08-20 21:56:30 +00:00
feedtype = ' from the New Releases RSS Feed from Demonoid '
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
verify = bool ( mylar . CONFIG . PUBLIC_VERIFY )
2016-08-20 21:56:30 +00:00
elif pickfeed == " 999 " : #WWT rss feed
2017-09-06 01:27:54 +00:00
feed = mylar . WWTURL + ' rss.php?cat=132,50 '
2016-08-20 21:56:30 +00:00
feedtype = ' from the New Releases RSS Feed from WorldWideTorrents '
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
verify = bool ( mylar . CONFIG . PUBLIC_VERIFY )
FIX: if 32p was disabled due to inability to signon, would still attempt to retrieve cached result when match occured which would then possibly result in excessive attempted logins, IMP: Added Force Type option to comicdetails page which will allow the type of series to be forced to TPB/GN format if Mylar is unable to decipher it under normal circumstances (doing this will affect how files are parsed for the given series), IMP: TPB/GN File Parser will now account for mutiple issues of the same TPB series within the given directory, IMP: When enabling/disabling Force Type, will rename existing folder to accomodate new naming folder convention if required, IMP: Started to move some of the file rename/manipulation modules into a filer.py module for more consistency, IMP: Added a to Folder Format which when triggered will use the designated Series Type, IMP:(#2130) When importing, option now available for the final series destination path to use the imported path location instead of defaulting to the Comic Location base folder - status will be no longer be Archived in such cases. Will also not show previous imported series on subsequent import runs if the import directory has not changed (thnx @CuddleBear92), IMP: Added the codebase for a Rename Preview option into the mix - GUI available, but not linked, FIX: Removed DEM from RSS scans when Public Torrents option is enabled, FIX:(#2137) When adding series, if series indicated date in a different format other than just numeric, would cause error
2018-12-10 17:27:53 +00:00
elif int ( pickfeed ) > = 7 and feedinfo is not None and mylar . CONFIG . ENABLE_32P is True :
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
#personal 32P notification feeds.
#get the info here
feed = ' https://32pag.es/feeds.php?feed= ' + feedinfo [ ' feed ' ] + ' &user= ' + feedinfo [ ' user ' ] + ' &auth= ' + feedinfo [ ' auth ' ] + ' &passkey= ' + feedinfo [ ' passkey ' ] + ' &authkey= ' + feedinfo [ ' authkey ' ] + ' &name= ' + feedinfo [ ' feedname ' ]
feedtype = ' from your Personal Notification Feed : ' + feedinfo [ ' feedname ' ]
2017-10-25 18:33:56 +00:00
verify = bool ( mylar . CONFIG . VERIFY_32P )
2014-04-14 17:59:27 +00:00
else :
logger . error ( ' invalid pickfeed denoted... ' )
return
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
#if pickfeed == '2' or pickfeed == '3':
# picksite = 'TPSE'
2016-08-20 21:56:30 +00:00
#if pickfeed == '2':
2017-09-06 01:27:54 +00:00
# feedme = tpse.
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
if pickfeed == ' 5 ' or pickfeed == ' 6 ' :
2016-08-20 21:56:30 +00:00
picksite = ' DEM '
elif pickfeed == ' 999 ' :
picksite = ' WWT '
elif pickfeed == ' 1 ' or pickfeed == ' 4 ' or int ( pickfeed ) > 7 :
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
picksite = ' 32P '
2014-09-05 06:19:26 +00:00
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
if all ( [ pickfeed != ' 4 ' , pickfeed != ' 3 ' , pickfeed != ' 5 ' ] ) :
FIX: Added user-agent to all CV queries, and switched all queries to utilize the requests module, FIX: Added User-Agent to ComicTagger and switched to requests module for all CV queries, FIX: Removed libraryscan option from GUI as no longer used, FIX: Ability to sort 'Have' column on main index page properly now (by % complete), FIX: Fixed some display issues with the series detail page and displaying, FIX: Metatagging should now be working again for story-arc, and one-off post-processing, FIX: Fixed post-processing problem with decimal places if number was padded, FIX: Updated CV-URL to point to new CV api location, FIX: Fixed problem when file-checking and series contained numbers and/or decimals, would take the modified series name instead of the actual series name resulting in some missed matches, IMP: Added another keyword to ignore when checking for annuals against a particular series, FIX:(#1210) When importing files, if issues were meta-tagged with CVS would not scan the metadata properly, FIX: Fixed checkboxes on annuals table so drop-down will work again (just doesn't refresh the screen afterwards atm), FIX:(#1182) Notifications not respecting http base, IMP: Added option to specify SSL Verification on/off per provider when searching/downloading, FIX: Possible fix for cache_dir not being used on restarts of mylar, FIX: configparser check would only check on linux systems, and if not present would cause errors during post-processing on non nix-based systems, FIX:(#1181) Manual renaming an entire series would fail if lowercase_filenames was enabled as an option
2016-02-25 16:40:09 +00:00
payload = None
2017-03-15 17:28:59 +00:00
2017-03-15 18:40:17 +00:00
ddos_protection = round ( random . uniform ( 0 , 15 ) , 2 )
time . sleep ( ddos_protection )
2017-03-15 17:28:59 +00:00
2018-09-06 16:49:50 +00:00
logger . info ( ' Now retrieving feed from %s ' % picksite )
FIX: Added user-agent to all CV queries, and switched all queries to utilize the requests module, FIX: Added User-Agent to ComicTagger and switched to requests module for all CV queries, FIX: Removed libraryscan option from GUI as no longer used, FIX: Ability to sort 'Have' column on main index page properly now (by % complete), FIX: Fixed some display issues with the series detail page and displaying, FIX: Metatagging should now be working again for story-arc, and one-off post-processing, FIX: Fixed post-processing problem with decimal places if number was padded, FIX: Updated CV-URL to point to new CV api location, FIX: Fixed problem when file-checking and series contained numbers and/or decimals, would take the modified series name instead of the actual series name resulting in some missed matches, IMP: Added another keyword to ignore when checking for annuals against a particular series, FIX:(#1210) When importing files, if issues were meta-tagged with CVS would not scan the metadata properly, FIX: Fixed checkboxes on annuals table so drop-down will work again (just doesn't refresh the screen afterwards atm), FIX:(#1182) Notifications not respecting http base, IMP: Added option to specify SSL Verification on/off per provider when searching/downloading, FIX: Possible fix for cache_dir not being used on restarts of mylar, FIX: configparser check would only check on linux systems, and if not present would cause errors during post-processing on non nix-based systems, FIX:(#1181) Manual renaming an entire series would fail if lowercase_filenames was enabled as an option
2016-02-25 16:40:09 +00:00
try :
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
headers = { ' Accept-encoding ' : ' gzip ' ,
' User-Agent ' : mylar . CV_HEADERS [ ' User-Agent ' ] }
2016-09-07 04:04:42 +00:00
cf_cookievalue = None
2016-09-07 05:34:51 +00:00
scraper = cfscrape . create_scraper ( )
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
if pickfeed == ' 999 ' :
if all ( [ pickfeed == ' 999 ' , mylar . WWT_CF_COOKIEVALUE is None ] ) :
try :
cf_cookievalue , cf_user_agent = scraper . get_tokens ( feed , user_agent = mylar . CV_HEADERS [ ' User-Agent ' ] )
except Exception as e :
logger . warn ( ' [WWT-RSSFEED] Unable to retrieve RSS properly: %s ' % e )
lp + = 1
continue
else :
mylar . WWT_CF_COOKIEVALUE = cf_cookievalue
cookievalue = cf_cookievalue
elif pickfeed == ' 999 ' :
cookievalue = mylar . WWT_CF_COOKIEVALUE
2016-09-07 04:04:42 +00:00
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
r = scraper . get ( feed , verify = verify , cookies = cookievalue , headers = headers )
2016-09-07 04:04:42 +00:00
else :
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
r = scraper . get ( feed , verify = verify , headers = headers )
FIX: Added user-agent to all CV queries, and switched all queries to utilize the requests module, FIX: Added User-Agent to ComicTagger and switched to requests module for all CV queries, FIX: Removed libraryscan option from GUI as no longer used, FIX: Ability to sort 'Have' column on main index page properly now (by % complete), FIX: Fixed some display issues with the series detail page and displaying, FIX: Metatagging should now be working again for story-arc, and one-off post-processing, FIX: Fixed post-processing problem with decimal places if number was padded, FIX: Updated CV-URL to point to new CV api location, FIX: Fixed problem when file-checking and series contained numbers and/or decimals, would take the modified series name instead of the actual series name resulting in some missed matches, IMP: Added another keyword to ignore when checking for annuals against a particular series, FIX:(#1210) When importing files, if issues were meta-tagged with CVS would not scan the metadata properly, FIX: Fixed checkboxes on annuals table so drop-down will work again (just doesn't refresh the screen afterwards atm), FIX:(#1182) Notifications not respecting http base, IMP: Added option to specify SSL Verification on/off per provider when searching/downloading, FIX: Possible fix for cache_dir not being used on restarts of mylar, FIX: configparser check would only check on linux systems, and if not present would cause errors during post-processing on non nix-based systems, FIX:(#1181) Manual renaming an entire series would fail if lowercase_filenames was enabled as an option
2016-02-25 16:40:09 +00:00
except Exception , e :
logger . warn ( ' Error fetching RSS Feed Data from %s : %s ' % ( picksite , e ) )
2017-01-25 18:27:03 +00:00
lp + = 1
continue
FIX: Added user-agent to all CV queries, and switched all queries to utilize the requests module, FIX: Added User-Agent to ComicTagger and switched to requests module for all CV queries, FIX: Removed libraryscan option from GUI as no longer used, FIX: Ability to sort 'Have' column on main index page properly now (by % complete), FIX: Fixed some display issues with the series detail page and displaying, FIX: Metatagging should now be working again for story-arc, and one-off post-processing, FIX: Fixed post-processing problem with decimal places if number was padded, FIX: Updated CV-URL to point to new CV api location, FIX: Fixed problem when file-checking and series contained numbers and/or decimals, would take the modified series name instead of the actual series name resulting in some missed matches, IMP: Added another keyword to ignore when checking for annuals against a particular series, FIX:(#1210) When importing files, if issues were meta-tagged with CVS would not scan the metadata properly, FIX: Fixed checkboxes on annuals table so drop-down will work again (just doesn't refresh the screen afterwards atm), FIX:(#1182) Notifications not respecting http base, IMP: Added option to specify SSL Verification on/off per provider when searching/downloading, FIX: Possible fix for cache_dir not being used on restarts of mylar, FIX: configparser check would only check on linux systems, and if not present would cause errors during post-processing on non nix-based systems, FIX:(#1181) Manual renaming an entire series would fail if lowercase_filenames was enabled as an option
2016-02-25 16:40:09 +00:00
feedme = feedparser . parse ( r . content )
2016-08-20 21:56:30 +00:00
#logger.info(feedme) #<-- uncomment this to see what Mylar is retrieving from the feed
FIX: Added user-agent to all CV queries, and switched all queries to utilize the requests module, FIX: Added User-Agent to ComicTagger and switched to requests module for all CV queries, FIX: Removed libraryscan option from GUI as no longer used, FIX: Ability to sort 'Have' column on main index page properly now (by % complete), FIX: Fixed some display issues with the series detail page and displaying, FIX: Metatagging should now be working again for story-arc, and one-off post-processing, FIX: Fixed post-processing problem with decimal places if number was padded, FIX: Updated CV-URL to point to new CV api location, FIX: Fixed problem when file-checking and series contained numbers and/or decimals, would take the modified series name instead of the actual series name resulting in some missed matches, IMP: Added another keyword to ignore when checking for annuals against a particular series, FIX:(#1210) When importing files, if issues were meta-tagged with CVS would not scan the metadata properly, FIX: Fixed checkboxes on annuals table so drop-down will work again (just doesn't refresh the screen afterwards atm), FIX:(#1182) Notifications not respecting http base, IMP: Added option to specify SSL Verification on/off per provider when searching/downloading, FIX: Possible fix for cache_dir not being used on restarts of mylar, FIX: configparser check would only check on linux systems, and if not present would cause errors during post-processing on non nix-based systems, FIX:(#1181) Manual renaming an entire series would fail if lowercase_filenames was enabled as an option
2016-02-25 16:40:09 +00:00
2014-09-05 06:19:26 +00:00
i = 0
2015-05-14 09:33:40 +00:00
2015-08-11 21:56:22 +00:00
if pickfeed == ' 4 ' :
for entry in searchresults [ ' entries ' ] :
justdigits = entry [ ' file_size ' ] #size not available in follow-list rss feed
seeddigits = entry [ ' seeders ' ] #number of seeders not available in follow-list rss feed
2017-10-25 18:33:56 +00:00
if int ( seeddigits ) > = int ( mylar . CONFIG . MINSEEDS ) :
2015-08-11 21:56:22 +00:00
torthe32p . append ( {
' site ' : picksite ,
' title ' : entry [ ' torrent_seriesname ' ] . lstrip ( ) + ' ' + entry [ ' torrent_seriesvol ' ] + ' # ' + entry [ ' torrent_seriesiss ' ] ,
' volume ' : entry [ ' torrent_seriesvol ' ] , # not stored by mylar yet.
' issue ' : entry [ ' torrent_seriesiss ' ] , # not stored by mylar yet.
' link ' : entry [ ' torrent_id ' ] , #just the id for the torrent
' pubdate ' : entry [ ' pubdate ' ] ,
' size ' : entry [ ' file_size ' ] ,
' seeders ' : entry [ ' seeders ' ] ,
' files ' : entry [ ' num_files ' ]
} )
i + = 1
2016-08-20 21:56:30 +00:00
elif pickfeed == ' 3 ' :
#TP.SE RSS FEED (parse)
pass
elif pickfeed == ' 5 ' :
#DEMONOID SEARCH RESULT (parse)
pass
elif pickfeed == " 999 " :
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
#try:
# feedme = feedparser.parse(feed)
#except Exception, e:
# logger.warn('Error fetching RSS Feed Data from %s: %s' % (picksite, e))
# lp+=1
# continue
2016-08-20 21:56:30 +00:00
#WWT / FEED
for entry in feedme . entries :
tmpsz = entry . description
tmpsz_st = tmpsz . find ( ' Size: ' ) + 6
if ' GB ' in tmpsz [ tmpsz_st : ] :
szform = ' GB '
sz = ' G '
elif ' MB ' in tmpsz [ tmpsz_st : ] :
szform = ' MB '
sz = ' M '
linkwwt = urlparse . parse_qs ( urlparse . urlparse ( entry . link ) . query ) [ ' id ' ]
feeddata . append ( {
' site ' : picksite ,
' title ' : entry . title ,
' link ' : ' ' . join ( linkwwt ) ,
' pubdate ' : entry . updated ,
' size ' : helpers . human2bytes ( str ( tmpsz [ tmpsz_st : tmpsz . find ( szform , tmpsz_st ) - 1 ] ) + str ( sz ) ) #+ 2 is for the length of the MB/GB in the size.
} )
i + = 1
2015-08-11 21:56:22 +00:00
else :
for entry in feedme [ ' entries ' ] :
2016-08-20 21:56:30 +00:00
#DEMONOID / FEED
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
if pickfeed == " 6 " :
2016-08-20 21:56:30 +00:00
tmpsz = feedme . entries [ i ] . description
2017-06-29 17:50:00 +00:00
tmpsz_st = tmpsz . find ( ' Size ' )
if tmpsz_st != - 1 :
tmpsize = tmpsz [ tmpsz_st : tmpsz_st + 14 ]
2017-07-09 18:51:54 +00:00
if any ( [ ' GB ' in tmpsize , ' MB ' in tmpsize , ' KB ' in tmpsize , ' TB ' in tmpsize ] ) :
2017-06-29 17:50:00 +00:00
tmp1 = tmpsz . find ( ' MB ' , tmpsz_st )
if tmp1 == - 1 :
tmp1 = tmpsz . find ( ' GB ' , tmpsz_st )
if tmp1 == - 1 :
tmp1 = tmpsz . find ( ' TB ' , tmpsz_st )
2017-07-09 18:51:54 +00:00
if tmp1 == - 1 :
tmp1 = tmpsz . find ( ' KB ' , tmpsz_st )
2017-06-29 17:50:00 +00:00
tmpsz_end = tmp1 + 2
tmpsz_st + = 7
else :
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
tmpsz = tmpsz [ : 80 ] #limit it to the first 80 so it doesn't pick up alt covers mistakingly
2017-06-29 17:50:00 +00:00
tmpsz_st = tmpsz . rfind ( ' | ' )
if tmpsz_st != - 1 :
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
tmpsz_end = tmpsz . find ( ' <br /> ' , tmpsz_st )
tmpsize = tmpsz [ tmpsz_st : tmpsz_end ] #st+14]
2017-07-09 18:51:54 +00:00
if any ( [ ' GB ' in tmpsize , ' MB ' in tmpsize , ' KB ' in tmpsize , ' TB ' in tmpsize ] ) :
2017-06-29 17:50:00 +00:00
tmp1 = tmpsz . find ( ' MB ' , tmpsz_st )
if tmp1 == - 1 :
tmp1 = tmpsz . find ( ' GB ' , tmpsz_st )
if tmp1 == - 1 :
tmp1 = tmpsz . find ( ' TB ' , tmpsz_st )
2017-07-09 18:51:54 +00:00
if tmp1 == - 1 :
tmp1 = tmpsz . find ( ' KB ' , tmpsz_st )
2017-06-29 17:50:00 +00:00
tmpsz_end = tmp1 + 2
tmpsz_st + = 2
2017-07-13 18:03:32 +00:00
if ' KB ' in tmpsz [ tmpsz_st : tmpsz_end ] :
szform = ' KB '
sz = ' K '
elif ' GB ' in tmpsz [ tmpsz_st : tmpsz_end ] :
2016-08-20 21:56:30 +00:00
szform = ' GB '
sz = ' G '
2017-06-29 17:50:00 +00:00
elif ' MB ' in tmpsz [ tmpsz_st : tmpsz_end ] :
2016-08-20 21:56:30 +00:00
szform = ' MB '
sz = ' M '
2017-07-09 18:51:54 +00:00
elif ' TB ' in tmpsz [ tmpsz_st : tmpsz_end ] :
szform = ' TB '
sz = ' T '
2017-06-29 17:50:00 +00:00
tsize = helpers . human2bytes ( str ( tmpsz [ tmpsz_st : tmpsz . find ( szform , tmpsz_st ) - 1 ] ) + str ( sz ) )
#timestamp is in YYYY-MM-DDTHH:MM:SS+TZ :/
dt = feedme . entries [ i ] . updated
try :
pd = datetime . strptime ( dt [ 0 : 19 ] , ' % Y- % m- %d T % H: % M: % S ' )
pdate = pd . strftime ( ' %a , %d % b % Y % H: % M: % S ' ) + ' ' + re . sub ( ' : ' , ' ' , dt [ 19 : ] ) . strip ( )
#if dt[19]=='+':
# pdate+=timedelta(hours=int(dt[20:22]), minutes=int(dt[23:]))
#elif dt[19]=='-':
# pdate-=timedelta(hours=int(dt[20:22]), minutes=int(dt[23:]))
except :
pdate = feedme . entries [ i ] . updated
2016-08-20 21:56:30 +00:00
feeddata . append ( {
2015-08-28 18:50:29 +00:00
' site ' : picksite ,
' title ' : feedme . entries [ i ] . title ,
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
' link ' : str ( re . sub ( ' genid= ' , ' ' , urlparse . urlparse ( feedme . entries [ i ] . link ) [ 4 ] ) . strip ( ) ) ,
#'link': str(urlparse.urlparse(feedme.entries[i].link)[2].rpartition('/')[0].rsplit('/',2)[2]),
2017-06-29 17:50:00 +00:00
' pubdate ' : pdate ,
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
' size ' : tsize
2015-08-28 18:50:29 +00:00
} )
2016-08-20 21:56:30 +00:00
#32p / FEEDS
2015-08-11 21:56:22 +00:00
elif pickfeed == " 1 " or int ( pickfeed ) > 7 :
2015-08-28 18:50:29 +00:00
tmpdesc = feedme . entries [ i ] . description
st_pub = feedme . entries [ i ] . title . find ( ' ( ' )
st_end = feedme . entries [ i ] . title . find ( ' ) ' )
pub = feedme . entries [ i ] . title [ st_pub + 1 : st_end ] # +1 to not include (
#logger.fdebug('publisher: ' + re.sub("'",'', pub).strip()) #publisher sometimes is given within quotes for some reason, strip 'em.
vol_find = feedme . entries [ i ] . title . find ( ' vol. ' )
series = feedme . entries [ i ] . title [ st_end + 1 : vol_find ] . strip ( )
FIX:(#1222) Fixed usage with NZBHydra - will now be able to properly grab the nzb files, as well as proper logging and handling of Failed downloading, IMP: Duplicate Directory Dump option available in Configuration GUI. Any duplicates discovered during post-processing will be moved into this directory (if enabled) depending on the dupe constraints, FIX: Better handling of titles with '&' and '-' in the titles (as well as annuals) when adding series which should mean more accurate results when trying to add a series, FIX:(#1142) If files didn't have the pages field metadata within the comicinfo.xml file, would error out and either fail to display the issue, or fail to scan the issue during an import scan, FIX: When adding/refreshing a series, if the cover image from CV is unable to be retrieved or is not of an adequate size, fallback to a differnt quality image from CV, FIX: When refreshing/adding a series, annuals will only be checked against once (it was previously running through the entire annual check twice), FIX: During RSS scans/checks if a title in the results had an encoded & (&), would store it as the html which would never match up when doing actual comparison searches, IMP: Fixed usage of feedparser module in rss feeds so that it only uses the retrieved data and doesn't do the actual polling against the url (requests module now does), IMP: Added proper handling of error code 910 with dognzb (max api hits), so that once it hits the 910 error it will disable dognzb as a provider, FIX: When attempting to display issue details on a series detail page (the i icon in the issues table), if the metadata in the .cbz cannot be read or doesn't exist, will now display a graphical warning instead of a 500 error, IMP: Added fork/fork version/tag to comictagger user-agent/version, IMP: Removed configparser dependency from ComicTagger, FIX: When performing searches, improved volume label matching regardless of how the volume label is represented
2016-03-04 20:04:19 +00:00
series = re . sub ( ' & ' , ' & ' , series ) . strip ( )
2015-08-28 18:50:29 +00:00
#logger.fdebug('series title: ' + series)
iss_st = feedme . entries [ i ] . title . find ( ' - ' , vol_find )
vol = re . sub ( ' \ . ' , ' ' , feedme . entries [ i ] . title [ vol_find : iss_st ] ) . strip ( )
#logger.fdebug('volume #: ' + str(vol))
issue = feedme . entries [ i ] . title [ iss_st + 3 : ] . strip ( )
#logger.fdebug('issue # : ' + str(issue))
2017-04-04 15:19:40 +00:00
try :
justdigits = feedme . entries [ i ] . torrent_contentlength
except :
justdigits = ' 0 '
2015-08-28 18:50:29 +00:00
seeddigits = 0
2015-08-11 21:56:22 +00:00
FIX:(#1630) One-off issues will now be post-processed according to grab-bag dir location, IMP: One-off pull-list issues will now have the status marked accordingly on weekly pullist for tracking purposes, FIX: Fix for utorrent not being able to update status properly after initial snatch, FIX: Fix for some incorrect variable references due to different snatch methods when trying to run on-snatch scripts, FIX: Fix for auto-torrent-snatcher trying to snatch a torrent with an '&' in the filename, FIX:(#1637) Fix for telegram not saving on snatch toggle properly, IMP: added additional logging for metatagging when attempting to create temp folder in cache location, IMP: will now clean up any left over metagtagging directories that fail during normal post-processing instead of leaving and continuing, FIX: Will notify on one-off grab's/storyarc's being post-processed, FIX: fix for displaying cbz issue details (the 'i' on the comic details page) in which the series title contained non-alphanumeric characters, IMP: Added ability to change status to Wanted on Upcoming tab (will perform an immediate search on selected issues), IMP: Threaded the one-off search call from the weeklypull
2017-06-02 14:05:06 +00:00
#if '0-Day Comics Pack' in series:
# logger.info('Comic Pack detected : ' + series)
# itd = True
2017-10-25 18:33:56 +00:00
if int ( mylar . CONFIG . MINSEEDS ) > = int ( seeddigits ) :
FIX: When retrieving feeds from 32p and in Auth mode, personal notification feeds contained some invalid html entries that weren't removed properly resulting in no results when attempting to match for downloading, FIX: When searching 32P, if title had a '/' within the title - Mylar would mistakingly skip it due to some previous exceptions that were made for CBT, FIX: Main page would quickly display & hide the have% column instead of always being hidden, FIX: Adjusted some incorrect spacing for non-alphanumeric characters when comparing search results (should result in better matching hopefully), FIX: When adding a series and the most recent issue was present on the weekly-pull list, it would sometimes not mark it as Wanted and auto-attempt to search for it (if auto mark Upcoming enabled), FIX: Added Test Connection button for 32P where it will test logon credentials as well as if Captcha is present, IMP: If captcha is enabled for 32p and signon is required because keys are stale, will not send authentication information and will just bypass as a provider, IMP: Test Connection button added for SABnzbd, IMP: Added ability to directly add torrents to rtorrent and apply label + download directory options (config.ini only atm), FIX: If a search result had a 'vol.' label in it, depending on how the format of the label was mylar would refuse to remove the volume which resulted in failed matches (also fixed a similar issue with failing to remove the volume label when comparing search results), FIX: When filechecking, if a series had a - in the title, will now account for it properly, IMP: Completely redid the filecheck module which allows for integration into other modules as well as more detailed failure logs, IMP: Added Dynamic handder integration into filechecker and subsequent modules that use it which allows for special characters to be replaced with any other type of character, IMP: Manual post-processing speed improved greatly due to new usage of filecheck module, IMP: Importer backend code redone to include new filecheck module, IMP: Added status/counter to import process, IMP: Added force unlock option to importer for failed imports, IMP: Added new status to Import labelled as 'Manual Intervention' for imports that need the user to manually select an option from an available list, FIX: When import said there were search results to view, but none available - would blank screen, IMP: Added a failure log entry showing all the failed files that weren't able to be scanned in during an import (will be in GUI eventually), IMP: if only partial metadata is available during import, Mylar will attempt to use what's available from the metatagging instead of picking all of one/other, IMP: Better grouping of series/volumes when viewing the import results page as well as now indicating if annuals are present within the files, IMP: Added a file-icon beside each imported item on the import result page which allows the user to view the files that are associated with the given series grouping, IMP: Added a blacklisted_publishers option to config.ini which will blacklist specific publishers from being returned during search / import results, FIX: If duplicate dump folder had a value, but duplicate dump wasn't enabled - would still use the duplicate dump folder during post-processing runs, FIX: (#1194) Patch to allow for fixed H1 elements for title (thnx chazlarson), FIX: Removed UnRAR dependency checks in cmtagmylar since not being used anymore, FIX: Fixed a problem with non-ascii characters being recognized during a file-check in certain cases, IMP: Attmept by Mylar to grab an alternate jpg from file when viewing the issue details if it complies with the naming conventions, FIX: Fixed some metatagging issues with ComicBookLover tags not being handled properly if they didn't exist, IMP: Dupecheck now has a failback if it's comparing a cbr/cbr, cbz/cbz and cbr/cbz-priority is enabled, FIX: Quick check added for when adding/refreshing a comic that if a cover already existed, it would delete the cover prior to the attempt to retrieve it, IMP: Added some additional handling for when searching/adding fails, FIX: If a story arc didn't have proper issue dates (or invalid ones) would error out on loading the story arc main page - usually when arcs were imported using a cbl file.
2016-04-07 17:09:06 +00:00
#new releases has it as '&id', notification feeds have it as %ampid (possibly even &id
2015-08-11 21:56:22 +00:00
link = feedme . entries [ i ] . link
FIX: When retrieving feeds from 32p and in Auth mode, personal notification feeds contained some invalid html entries that weren't removed properly resulting in no results when attempting to match for downloading, FIX: When searching 32P, if title had a '/' within the title - Mylar would mistakingly skip it due to some previous exceptions that were made for CBT, FIX: Main page would quickly display & hide the have% column instead of always being hidden, FIX: Adjusted some incorrect spacing for non-alphanumeric characters when comparing search results (should result in better matching hopefully), FIX: When adding a series and the most recent issue was present on the weekly-pull list, it would sometimes not mark it as Wanted and auto-attempt to search for it (if auto mark Upcoming enabled), FIX: Added Test Connection button for 32P where it will test logon credentials as well as if Captcha is present, IMP: If captcha is enabled for 32p and signon is required because keys are stale, will not send authentication information and will just bypass as a provider, IMP: Test Connection button added for SABnzbd, IMP: Added ability to directly add torrents to rtorrent and apply label + download directory options (config.ini only atm), FIX: If a search result had a 'vol.' label in it, depending on how the format of the label was mylar would refuse to remove the volume which resulted in failed matches (also fixed a similar issue with failing to remove the volume label when comparing search results), FIX: When filechecking, if a series had a - in the title, will now account for it properly, IMP: Completely redid the filecheck module which allows for integration into other modules as well as more detailed failure logs, IMP: Added Dynamic handder integration into filechecker and subsequent modules that use it which allows for special characters to be replaced with any other type of character, IMP: Manual post-processing speed improved greatly due to new usage of filecheck module, IMP: Importer backend code redone to include new filecheck module, IMP: Added status/counter to import process, IMP: Added force unlock option to importer for failed imports, IMP: Added new status to Import labelled as 'Manual Intervention' for imports that need the user to manually select an option from an available list, FIX: When import said there were search results to view, but none available - would blank screen, IMP: Added a failure log entry showing all the failed files that weren't able to be scanned in during an import (will be in GUI eventually), IMP: if only partial metadata is available during import, Mylar will attempt to use what's available from the metatagging instead of picking all of one/other, IMP: Better grouping of series/volumes when viewing the import results page as well as now indicating if annuals are present within the files, IMP: Added a file-icon beside each imported item on the import result page which allows the user to view the files that are associated with the given series grouping, IMP: Added a blacklisted_publishers option to config.ini which will blacklist specific publishers from being returned during search / import results, FIX: If duplicate dump folder had a value, but duplicate dump wasn't enabled - would still use the duplicate dump folder during post-processing runs, FIX: (#1194) Patch to allow for fixed H1 elements for title (thnx chazlarson), FIX: Removed UnRAR dependency checks in cmtagmylar since not being used anymore, FIX: Fixed a problem with non-ascii characters being recognized during a file-check in certain cases, IMP: Attmept by Mylar to grab an alternate jpg from file when viewing the issue details if it complies with the naming conventions, FIX: Fixed some metatagging issues with ComicBookLover tags not being handled properly if they didn't exist, IMP: Dupecheck now has a failback if it's comparing a cbr/cbr, cbz/cbz and cbr/cbz-priority is enabled, FIX: Quick check added for when adding/refreshing a comic that if a cover already existed, it would delete the cover prior to the attempt to retrieve it, IMP: Added some additional handling for when searching/adding fails, FIX: If a story arc didn't have proper issue dates (or invalid ones) would error out on loading the story arc main page - usually when arcs were imported using a cbl file.
2016-04-07 17:09:06 +00:00
link = re . sub ( ' & ' , ' & ' , link )
link = re . sub ( ' & ' , ' & ' , link )
2015-08-11 21:56:22 +00:00
linkst = link . find ( ' &id ' )
linken = link . find ( ' & ' , linkst + 1 )
if linken == - 1 :
linken = len ( link )
newlink = re . sub ( ' &id= ' , ' ' , link [ linkst : linken ] ) . strip ( )
feeddata . append ( {
' site ' : picksite ,
' title ' : series . lstrip ( ) + ' ' + vol + ' # ' + issue ,
' volume ' : vol , # not stored by mylar yet.
' issue ' : issue , # not stored by mylar yet.
' link ' : newlink , #just the id for the torrent
' pubdate ' : feedme . entries [ i ] . updated ,
' size ' : justdigits
} )
i + = 1
2014-04-14 17:59:27 +00:00
if feedtype is None :
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
logger . info ( ' [ ' + picksite + ' ] there were ' + str ( i ) + ' results.. ' )
2014-04-14 17:59:27 +00:00
else :
2015-05-14 09:33:40 +00:00
logger . info ( ' [ ' + picksite + ' ] there were ' + str ( i ) + ' results ' + feedtype )
2014-09-05 06:19:26 +00:00
totalcount + = i
2015-05-22 08:32:51 +00:00
lp + = 1
2013-10-01 18:37:42 +00:00
2013-08-07 06:27:12 +00:00
if not seriesname :
2015-08-11 21:56:22 +00:00
#rss search results
2015-05-22 08:32:51 +00:00
rssdbupdate ( feeddata , totalcount , ' torrent ' )
2013-08-07 06:27:12 +00:00
else :
2015-08-11 21:56:22 +00:00
#backlog (parsing) search results
if pickfeed == ' 4 ' :
torinfo [ ' entries ' ] = torthe32p
else :
2016-08-20 21:56:30 +00:00
torinfo [ ' entries ' ] = torthetpse
2015-08-11 21:56:22 +00:00
return torinfo
2013-07-30 04:57:37 +00:00
return
2019-03-08 21:56:05 +00:00
def ddl ( forcerss = False ) :
headers = { ' User-Agent ' : ' Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.1 ' }
ddl_feed = ' https://getcomics.info/feed/ '
try :
r = requests . get ( ddl_feed , verify = True , headers = headers )
except Exception , e :
logger . warn ( ' Error fetching RSS Feed Data from DDL: %s ' % ( e ) )
return False
else :
if r . status_code != 200 :
#typically 403 will not return results, but just catch anything other than a 200
if r . status_code == 403 :
logger . warn ( ' ERROR - status code: %s ' % r . status_code )
return False
else :
logger . warn ( ' [ %s ] Status code returned: %s ' % ( r . status_code ) )
return False
feedme = feedparser . parse ( r . content )
results = [ ]
for entry in feedme . entries :
soup = BeautifulSoup ( entry . summary , ' html.parser ' )
orig_find = soup . find ( " p " , { " style " : " text-align: center; " } )
i = 0
option_find = orig_find
while True : #i <= 10:
prev_option = option_find
option_find = option_find . findNext ( text = True )
if ' Year ' in option_find :
year = option_find . findNext ( text = True )
year = re . sub ( ' \ | ' , ' ' , year ) . strip ( )
else :
if ' Size ' in prev_option :
size = option_find #.findNext(text=True)
if ' - MB ' in size : size = ' 0 MB '
possible_more = orig_find . next_sibling
break
i + = 1
link = entry . link
title = entry . title
updated = entry . updated
if updated . endswith ( ' +0000 ' ) :
updated = updated [ : - 5 ] . strip ( )
tmpid = entry . id
id = tmpid [ tmpid . find ( ' = ' ) + 1 : ]
if ' KB ' in size :
szform = ' KB '
sz = ' K '
elif ' GB ' in size :
szform = ' GB '
sz = ' G '
elif ' MB ' in size :
szform = ' MB '
sz = ' M '
elif ' TB ' in size :
szform = ' TB '
sz = ' T '
tsize = helpers . human2bytes ( re . sub ( ' [^0-9] ' , ' ' , size ) . strip ( ) + sz )
#link can be referenced with the ?p=id url
results . append ( { ' Title ' : title ,
' Size ' : tsize ,
' Link ' : id ,
' Site ' : ' DDL ' ,
' Pubdate ' : updated } )
if len ( results ) > 0 :
logger . info ( ' [RSS][DDL] %s entries have been indexed and are now going to be stored for caching. ' % len ( results ) )
rssdbupdate ( results , len ( results ) , ' ddl ' )
return
2015-03-20 08:06:56 +00:00
2015-03-21 14:09:34 +00:00
def nzbs ( provider = None , forcerss = False ) :
2013-07-30 04:57:37 +00:00
2015-03-30 15:49:36 +00:00
feedthis = [ ]
2017-11-22 18:23:52 +00:00
def _parse_feed ( site , url , verify , payload = None ) :
2015-03-30 15:49:36 +00:00
logger . fdebug ( ' [RSS] Fetching items from ' + site )
FIX:(#1222) Fixed usage with NZBHydra - will now be able to properly grab the nzb files, as well as proper logging and handling of Failed downloading, IMP: Duplicate Directory Dump option available in Configuration GUI. Any duplicates discovered during post-processing will be moved into this directory (if enabled) depending on the dupe constraints, FIX: Better handling of titles with '&' and '-' in the titles (as well as annuals) when adding series which should mean more accurate results when trying to add a series, FIX:(#1142) If files didn't have the pages field metadata within the comicinfo.xml file, would error out and either fail to display the issue, or fail to scan the issue during an import scan, FIX: When adding/refreshing a series, if the cover image from CV is unable to be retrieved or is not of an adequate size, fallback to a differnt quality image from CV, FIX: When refreshing/adding a series, annuals will only be checked against once (it was previously running through the entire annual check twice), FIX: During RSS scans/checks if a title in the results had an encoded & (&), would store it as the html which would never match up when doing actual comparison searches, IMP: Fixed usage of feedparser module in rss feeds so that it only uses the retrieved data and doesn't do the actual polling against the url (requests module now does), IMP: Added proper handling of error code 910 with dognzb (max api hits), so that once it hits the 910 error it will disable dognzb as a provider, FIX: When attempting to display issue details on a series detail page (the i icon in the issues table), if the metadata in the .cbz cannot be read or doesn't exist, will now display a graphical warning instead of a 500 error, IMP: Added fork/fork version/tag to comictagger user-agent/version, IMP: Removed configparser dependency from ComicTagger, FIX: When performing searches, improved volume label matching regardless of how the volume label is represented
2016-03-04 20:04:19 +00:00
headers = { ' User-Agent ' : str ( mylar . USER_AGENT ) }
try :
r = requests . get ( url , params = payload , verify = verify , headers = headers )
except Exception , e :
logger . warn ( ' Error fetching RSS Feed Data from %s : %s ' % ( site , e ) )
return
2017-11-22 18:23:52 +00:00
if r . status_code != 200 :
#typically 403 will not return results, but just catch anything other than a 200
if r . status_code == 403 :
return False
else :
logger . warn ( ' [ %s ] Status code returned: %s ' % ( site , r . status_code ) )
if r . status_code == 503 :
logger . warn ( ' [ %s ] Site appears unresponsive/down. Disabling... ' % ( site ) )
return ' disable '
else :
return
FIX:(#1222) Fixed usage with NZBHydra - will now be able to properly grab the nzb files, as well as proper logging and handling of Failed downloading, IMP: Duplicate Directory Dump option available in Configuration GUI. Any duplicates discovered during post-processing will be moved into this directory (if enabled) depending on the dupe constraints, FIX: Better handling of titles with '&' and '-' in the titles (as well as annuals) when adding series which should mean more accurate results when trying to add a series, FIX:(#1142) If files didn't have the pages field metadata within the comicinfo.xml file, would error out and either fail to display the issue, or fail to scan the issue during an import scan, FIX: When adding/refreshing a series, if the cover image from CV is unable to be retrieved or is not of an adequate size, fallback to a differnt quality image from CV, FIX: When refreshing/adding a series, annuals will only be checked against once (it was previously running through the entire annual check twice), FIX: During RSS scans/checks if a title in the results had an encoded & (&), would store it as the html which would never match up when doing actual comparison searches, IMP: Fixed usage of feedparser module in rss feeds so that it only uses the retrieved data and doesn't do the actual polling against the url (requests module now does), IMP: Added proper handling of error code 910 with dognzb (max api hits), so that once it hits the 910 error it will disable dognzb as a provider, FIX: When attempting to display issue details on a series detail page (the i icon in the issues table), if the metadata in the .cbz cannot be read or doesn't exist, will now display a graphical warning instead of a 500 error, IMP: Added fork/fork version/tag to comictagger user-agent/version, IMP: Removed configparser dependency from ComicTagger, FIX: When performing searches, improved volume label matching regardless of how the volume label is represented
2016-03-04 20:04:19 +00:00
feedme = feedparser . parse ( r . content )
2015-03-30 15:49:36 +00:00
feedthis . append ( { " site " : site ,
" feed " : feedme } )
2013-07-30 04:57:37 +00:00
newznab_hosts = [ ]
2017-11-22 18:23:52 +00:00
if mylar . CONFIG . NEWZNAB is True :
2017-10-25 18:33:56 +00:00
for newznab_host in mylar . CONFIG . EXTRA_NEWZNABS :
FIX:(#1222) Fixed usage with NZBHydra - will now be able to properly grab the nzb files, as well as proper logging and handling of Failed downloading, IMP: Duplicate Directory Dump option available in Configuration GUI. Any duplicates discovered during post-processing will be moved into this directory (if enabled) depending on the dupe constraints, FIX: Better handling of titles with '&' and '-' in the titles (as well as annuals) when adding series which should mean more accurate results when trying to add a series, FIX:(#1142) If files didn't have the pages field metadata within the comicinfo.xml file, would error out and either fail to display the issue, or fail to scan the issue during an import scan, FIX: When adding/refreshing a series, if the cover image from CV is unable to be retrieved or is not of an adequate size, fallback to a differnt quality image from CV, FIX: When refreshing/adding a series, annuals will only be checked against once (it was previously running through the entire annual check twice), FIX: During RSS scans/checks if a title in the results had an encoded & (&), would store it as the html which would never match up when doing actual comparison searches, IMP: Fixed usage of feedparser module in rss feeds so that it only uses the retrieved data and doesn't do the actual polling against the url (requests module now does), IMP: Added proper handling of error code 910 with dognzb (max api hits), so that once it hits the 910 error it will disable dognzb as a provider, FIX: When attempting to display issue details on a series detail page (the i icon in the issues table), if the metadata in the .cbz cannot be read or doesn't exist, will now display a graphical warning instead of a 500 error, IMP: Added fork/fork version/tag to comictagger user-agent/version, IMP: Removed configparser dependency from ComicTagger, FIX: When performing searches, improved volume label matching regardless of how the volume label is represented
2016-03-04 20:04:19 +00:00
if str ( newznab_host [ 5 ] ) == ' 1 ' :
2013-07-30 04:57:37 +00:00
newznab_hosts . append ( newznab_host )
2017-11-22 18:23:52 +00:00
providercount = len ( newznab_hosts ) + int ( mylar . CONFIG . EXPERIMENTAL is True ) + int ( mylar . CONFIG . NZBSU is True ) + int ( mylar . CONFIG . DOGNZB is True )
2015-03-21 14:09:34 +00:00
logger . fdebug ( ' [RSS] You have enabled ' + str ( providercount ) + ' NZB RSS search providers. ' )
2013-07-30 04:57:37 +00:00
2017-11-22 18:23:52 +00:00
if providercount > 0 :
if mylar . CONFIG . EXPERIMENTAL == 1 :
max_entries = " 250 " if forcerss else " 50 "
params = { ' sort ' : ' agedesc ' ,
' max ' : max_entries ,
' more ' : ' 1 ' }
check = _parse_feed ( ' experimental ' , ' http://nzbindex.nl/rss/alt.binaries.comics.dcp ' , False , params )
if check == ' disable ' :
helpers . disable_provider ( site )
if mylar . CONFIG . NZBSU == 1 :
num_items = " &num=100 " if forcerss else " " # default is 25
params = { ' t ' : ' 7030 ' ,
' dl ' : ' 1 ' ,
' i ' : mylar . CONFIG . NZBSU_UID ,
' r ' : mylar . CONFIG . NZBSU_APIKEY ,
' num_items ' : num_items }
check = _parse_feed ( ' nzb.su ' , ' https://api.nzb.su/rss ' , mylar . CONFIG . NZBSU_VERIFY , params )
if check == ' disable ' :
helpers . disable_provider ( site )
if mylar . CONFIG . DOGNZB == 1 :
num_items = " &num=100 " if forcerss else " " # default is 25
params = { ' t ' : ' 7030 ' ,
' r ' : mylar . CONFIG . DOGNZB_APIKEY ,
' num_items ' : num_items }
check = _parse_feed ( ' dognzb ' , ' https://dognzb.cr/rss.cfm ' , mylar . CONFIG . DOGNZB_VERIFY , params )
if check == ' disable ' :
helpers . disable_provider ( site )
for newznab_host in newznab_hosts :
site = newznab_host [ 0 ] . rstrip ( )
( newznabuid , _ , newznabcat ) = ( newznab_host [ 4 ] or ' ' ) . partition ( ' # ' )
newznabuid = newznabuid or ' 1 '
newznabcat = newznabcat or ' 7030 '
if site [ - 10 : ] == ' [nzbhydra] ' :
#to allow nzbhydra to do category search by most recent (ie. rss)
url = newznab_host [ 1 ] . rstrip ( ) + ' /api '
params = { ' t ' : ' search ' ,
' cat ' : str ( newznabcat ) ,
' dl ' : ' 1 ' ,
' apikey ' : newznab_host [ 3 ] . rstrip ( ) ,
' num ' : ' 100 ' }
check = _parse_feed ( site , url , bool ( newznab_host [ 2 ] ) , params )
else :
url = newznab_host [ 1 ] . rstrip ( ) + ' /rss '
params = { ' t ' : str ( newznabcat ) ,
' dl ' : ' 1 ' ,
' i ' : str ( newznabuid ) ,
' r ' : newznab_host [ 3 ] . rstrip ( ) ,
' num ' : ' 100 ' }
check = _parse_feed ( site , url , bool ( newznab_host [ 2 ] ) , params )
if check is False and ' rss ' in url [ - 3 : ] :
logger . fdebug ( ' RSS url returning 403 error. Attempting to use API to get most recent items in lieu of RSS feed ' )
url = newznab_host [ 1 ] . rstrip ( ) + ' /api '
params = { ' t ' : ' search ' ,
' cat ' : str ( newznabcat ) ,
' dl ' : ' 1 ' ,
' apikey ' : newznab_host [ 3 ] . rstrip ( ) ,
' num ' : ' 100 ' }
check = _parse_feed ( site , url , bool ( newznab_host [ 2 ] ) , params )
if check == ' disable ' :
helpers . disable_provider ( site , newznab = True )
feeddata = [ ]
for ft in feedthis :
site = ft [ ' site ' ]
logger . fdebug ( ' [RSS] ( ' + site + ' ) now being updated... ' )
for entry in ft [ ' feed ' ] . entries :
2015-03-30 15:49:36 +00:00
2017-11-22 18:23:52 +00:00
if site == ' dognzb ' :
#because the rss of dog doesn't carry the enclosure item, we'll use the newznab size value
size = 0
if ' newznab ' in entry and ' size ' in entry [ ' newznab ' ] :
size = entry [ ' newznab ' ] [ ' size ' ]
else :
# experimental, nzb.su, newznab
size = entry . enclosures [ 0 ] [ ' length ' ]
2015-03-30 15:49:36 +00:00
2017-11-22 18:23:52 +00:00
# Link
if site == ' experimental ' :
link = entry . enclosures [ 0 ] [ ' url ' ]
else :
# dognzb, nzb.su, newznab
link = entry . link
2015-03-21 14:09:34 +00:00
2017-11-22 18:23:52 +00:00
#Remove the API keys from the url to allow for possible api key changes
if site == ' dognzb ' :
link = re . sub ( mylar . CONFIG . DOGNZB_APIKEY , ' ' , link ) . strip ( )
else :
link = link [ : link . find ( ' &i= ' ) ] . strip ( )
2015-03-21 14:09:34 +00:00
2017-11-22 18:23:52 +00:00
feeddata . append ( { ' Site ' : site ,
' Title ' : entry . title ,
' Link ' : link ,
' Pubdate ' : entry . updated ,
' Size ' : size } )
2015-03-21 14:09:34 +00:00
2017-11-22 18:23:52 +00:00
logger . info ( ' [RSS] ( ' + site + ' ) ' + str ( len ( ft [ ' feed ' ] . entries ) ) + ' entries indexed. ' )
2015-03-21 14:09:34 +00:00
2017-11-22 18:23:52 +00:00
i = len ( feeddata )
if i :
logger . info ( ' [RSS] ' + str ( i ) + ' entries have been indexed and are now going to be stored for caching. ' )
rssdbupdate ( feeddata , i , ' usenet ' )
2015-05-22 08:32:51 +00:00
2013-07-30 04:57:37 +00:00
return
2015-05-22 08:32:51 +00:00
def rssdbupdate ( feeddata , i , type ) :
2013-07-30 04:57:37 +00:00
rsschktime = 15
myDB = db . DBConnection ( )
#let's add the entries into the db so as to save on searches
#also to build up the ID's ;)
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
for dataval in feeddata :
2013-07-30 04:57:37 +00:00
if type == ' torrent ' :
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
#we just store the torrent ID's now.
2016-08-20 21:56:30 +00:00
newVal = { " Link " : dataval [ ' link ' ] ,
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
" Pubdate " : dataval [ ' pubdate ' ] ,
" Site " : dataval [ ' site ' ] ,
" Size " : dataval [ ' size ' ] }
ctrlVal = { " Title " : dataval [ ' title ' ] }
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
2013-07-30 04:57:37 +00:00
else :
newlink = dataval [ ' Link ' ]
newVal = { " Link " : newlink ,
" Pubdate " : dataval [ ' Pubdate ' ] ,
" Site " : dataval [ ' Site ' ] ,
" Size " : dataval [ ' Size ' ] }
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
ctrlVal = { " Title " : dataval [ ' Title ' ] }
2013-07-30 04:57:37 +00:00
2015-05-22 08:32:51 +00:00
myDB . upsert ( " rssdb " , newVal , ctrlVal )
2013-07-30 04:57:37 +00:00
2017-10-25 18:33:56 +00:00
logger . fdebug ( ' Completed adding new data to RSS DB. Next add in ' + str ( mylar . CONFIG . RSS_CHECKINTERVAL ) + ' minutes ' )
2013-07-30 04:57:37 +00:00
return
2019-03-08 21:56:05 +00:00
def ddl_dbsearch ( seriesname , issue , comicid = None , nzbprov = None , oneoff = False ) :
myDB = db . DBConnection ( )
seriesname_alt = None
if any ( [ comicid is None , comicid == ' None ' , oneoff is True ] ) :
pass
else :
snm = myDB . selectone ( " SELECT * FROM comics WHERE comicid=? " , [ comicid ] ) . fetchone ( )
if snm is None :
logger . fdebug ( ' Invalid ComicID of %s . Aborting search ' % comicid )
return " no results "
else :
seriesname = snm [ ' ComicName ' ]
seriesname_alt = snm [ ' AlternateSearch ' ]
dsearch_rem1 = re . sub ( " \\ band \\ b " , " % " , seriesname . lower ( ) )
dsearch_rem2 = re . sub ( " \\ bthe \\ b " , " % " , dsearch_rem1 . lower ( ) )
dsearch_removed = re . sub ( ' \ s+ ' , ' ' , dsearch_rem2 )
dsearch_seriesname = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ - \ ; \ / \\ = \ ? \ & \ . \ s \ ,] ' , ' % ' , dsearch_removed )
dsearch = ' % ' + dsearch_seriesname + ' % '
dresults = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site= ' DDL ' " , [ dsearch ] )
ddltheinfo = [ ]
ddlinfo = { }
if not dresults :
return " no results "
else :
for dl in dresults :
ddltheinfo . append ( {
' title ' : dl [ ' Title ' ] ,
' link ' : dl [ ' Link ' ] ,
' pubdate ' : dl [ ' Pubdate ' ] ,
' site ' : dl [ ' Site ' ] ,
' length ' : dl [ ' Size ' ]
} )
ddlinfo [ ' entries ' ] = ddltheinfo
return ddlinfo
2015-05-22 08:32:51 +00:00
FIX:(#1630) One-off issues will now be post-processed according to grab-bag dir location, IMP: One-off pull-list issues will now have the status marked accordingly on weekly pullist for tracking purposes, FIX: Fix for utorrent not being able to update status properly after initial snatch, FIX: Fix for some incorrect variable references due to different snatch methods when trying to run on-snatch scripts, FIX: Fix for auto-torrent-snatcher trying to snatch a torrent with an '&' in the filename, FIX:(#1637) Fix for telegram not saving on snatch toggle properly, IMP: added additional logging for metatagging when attempting to create temp folder in cache location, IMP: will now clean up any left over metagtagging directories that fail during normal post-processing instead of leaving and continuing, FIX: Will notify on one-off grab's/storyarc's being post-processed, FIX: fix for displaying cbz issue details (the 'i' on the comic details page) in which the series title contained non-alphanumeric characters, IMP: Added ability to change status to Wanted on Upcoming tab (will perform an immediate search on selected issues), IMP: Threaded the one-off search call from the weeklypull
2017-06-02 14:05:06 +00:00
def torrentdbsearch ( seriesname , issue , comicid = None , nzbprov = None , oneoff = False ) :
2013-07-30 04:57:37 +00:00
myDB = db . DBConnection ( )
seriesname_alt = None
FIX:(#1630) One-off issues will now be post-processed according to grab-bag dir location, IMP: One-off pull-list issues will now have the status marked accordingly on weekly pullist for tracking purposes, FIX: Fix for utorrent not being able to update status properly after initial snatch, FIX: Fix for some incorrect variable references due to different snatch methods when trying to run on-snatch scripts, FIX: Fix for auto-torrent-snatcher trying to snatch a torrent with an '&' in the filename, FIX:(#1637) Fix for telegram not saving on snatch toggle properly, IMP: added additional logging for metatagging when attempting to create temp folder in cache location, IMP: will now clean up any left over metagtagging directories that fail during normal post-processing instead of leaving and continuing, FIX: Will notify on one-off grab's/storyarc's being post-processed, FIX: fix for displaying cbz issue details (the 'i' on the comic details page) in which the series title contained non-alphanumeric characters, IMP: Added ability to change status to Wanted on Upcoming tab (will perform an immediate search on selected issues), IMP: Threaded the one-off search call from the weeklypull
2017-06-02 14:05:06 +00:00
if any ( [ comicid is None , comicid == ' None ' , oneoff is True ] ) :
2013-07-30 04:57:37 +00:00
pass
else :
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
#logger.fdebug('ComicID: ' + str(comicid))
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
snm = myDB . selectone ( " SELECT * FROM comics WHERE comicid=? " , [ comicid ] ) . fetchone ( )
2013-07-30 04:57:37 +00:00
if snm is None :
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' Invalid ComicID of ' + str ( comicid ) + ' . Aborting search. ' )
2013-07-30 04:57:37 +00:00
return
else :
seriesname = snm [ ' ComicName ' ]
seriesname_alt = snm [ ' AlternateSearch ' ]
2013-08-19 06:14:47 +00:00
#remove 'and' and 'the':
tsearch_rem1 = re . sub ( " \\ band \\ b " , " % " , seriesname . lower ( ) )
2015-05-22 08:32:51 +00:00
tsearch_rem2 = re . sub ( " \\ bthe \\ b " , " % " , tsearch_rem1 . lower ( ) )
2013-08-19 06:14:47 +00:00
tsearch_removed = re . sub ( ' \ s+ ' , ' ' , tsearch_rem2 )
2017-02-11 23:57:19 +00:00
tsearch_seriesname = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ - \ ; \ / \\ = \ ? \ & \ . \ s \ ,] ' , ' % ' , tsearch_removed )
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . PREFERRED_QUALITY == 0 :
2014-12-01 17:23:49 +00:00
tsearch = tsearch_seriesname + " % "
2017-10-25 18:33:56 +00:00
elif mylar . CONFIG . PREFERRED_QUALITY == 1 :
2014-12-01 17:23:49 +00:00
tsearch = tsearch_seriesname + " %c br % "
2017-10-25 18:33:56 +00:00
elif mylar . CONFIG . PREFERRED_QUALITY == 2 :
2014-12-01 17:23:49 +00:00
tsearch = tsearch_seriesname + " %c bz % "
2015-05-22 08:32:51 +00:00
else :
2014-12-01 17:23:49 +00:00
tsearch = tsearch_seriesname + " % "
2018-03-22 14:00:34 +00:00
if seriesname == ' 0-Day Comics Pack - %s ' % ( issue [ : 4 ] ) :
#call the helper to get the month
tsearch + = ' vol %s ' % issue [ 5 : 7 ]
tsearch + = ' % '
tsearch + = ' # %s ' % issue [ 8 : 10 ]
tsearch + = ' % '
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
#logger.fdebug('tsearch : ' + tsearch)
2013-08-11 05:31:41 +00:00
AS_Alt = [ ]
tresults = [ ]
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
tsearch = ' % ' + tsearch
2013-08-11 05:31:41 +00:00
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . ENABLE_32P and nzbprov == ' 32P ' :
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
tresults = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site= ' 32P ' " , [ tsearch ] )
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
if mylar . CONFIG . ENABLE_PUBLIC and nzbprov == ' Public Torrents ' :
2016-08-20 21:56:30 +00:00
tresults + = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND (Site= ' DEM ' OR Site= ' WWT ' ) " , [ tsearch ] )
2013-08-11 05:31:41 +00:00
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
#logger.fdebug('seriesname_alt:' + str(seriesname_alt))
2013-08-11 05:31:41 +00:00
if seriesname_alt is None or seriesname_alt == ' None ' :
2018-03-22 14:00:34 +00:00
if not tresults :
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' no Alternate name given. Aborting search. ' )
2013-07-30 04:57:37 +00:00
return " no results "
2013-08-11 05:31:41 +00:00
else :
chkthealt = seriesname_alt . split ( ' ## ' )
if chkthealt == 0 :
AS_Alternate = seriesname_alt
AS_Alt . append ( seriesname_alt )
for calt in chkthealt :
2015-05-22 08:32:51 +00:00
AS_Alter = re . sub ( ' ## ' , ' ' , calt )
2013-08-11 05:31:41 +00:00
u_altsearchcomic = AS_Alter . encode ( ' ascii ' , ' ignore ' ) . strip ( )
2013-08-19 06:14:47 +00:00
AS_Altrem = re . sub ( " \\ band \\ b " , " " , u_altsearchcomic . lower ( ) )
AS_Altrem = re . sub ( " \\ bthe \\ b " , " " , AS_Altrem . lower ( ) )
AS_Alternate = re . sub ( ' [ \ _ \ # \ , \ / \ : \ ; \ . \ - \ ! \ $ \ % \ + \' \ & \ ? \ @ \ s] ' , ' % ' , AS_Altrem )
2013-09-05 02:36:41 +00:00
AS_Altrem_mod = re . sub ( ' [ \ &] ' , ' ' , AS_Altrem )
2017-02-11 23:57:19 +00:00
AS_formatrem_seriesname = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ ; \ / \\ = \ ? \ . \ ,] ' , ' ' , AS_Altrem_mod )
2013-09-05 02:36:41 +00:00
AS_formatrem_seriesname = re . sub ( ' \ s+ ' , ' ' , AS_formatrem_seriesname )
if AS_formatrem_seriesname [ : 1 ] == ' ' : AS_formatrem_seriesname = AS_formatrem_seriesname [ 1 : ]
AS_Alt . append ( AS_formatrem_seriesname )
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . PREFERRED_QUALITY == 0 :
2014-12-01 17:23:49 +00:00
AS_Alternate + = " % "
2017-10-25 18:33:56 +00:00
elif mylar . CONFIG . PREFERRED_QUALITY == 1 :
2014-12-01 17:23:49 +00:00
AS_Alternate + = " %c br % "
2017-10-25 18:33:56 +00:00
elif mylar . CONFIG . PREFERRED_QUALITY == 2 :
2014-12-01 17:23:49 +00:00
AS_Alternate + = " %c bz % "
else :
AS_Alternate + = " % "
2013-08-11 05:31:41 +00:00
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
AS_Alternate = ' % ' + AS_Alternate
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . ENABLE_32P and nzbprov == ' 32P ' :
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
tresults + = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site= ' 32P ' " , [ AS_Alternate ] )
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
if mylar . CONFIG . ENABLE_PUBLIC and nzbprov == ' Public Torrents ' :
2016-08-20 21:56:30 +00:00
tresults + = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND (Site= ' DEM ' OR Site= ' WWT ' ) " , [ AS_Alternate ] )
2013-08-11 05:31:41 +00:00
2018-03-22 14:00:34 +00:00
if not tresults :
logger . fdebug ( ' torrent search returned no results for %s ' % seriesname )
2013-08-11 05:31:41 +00:00
return " no results "
2013-07-30 04:57:37 +00:00
extensions = ( ' cbr ' , ' cbz ' )
tortheinfo = [ ]
torinfo = { }
for tor in tresults :
FIX:(#1222) Fixed usage with NZBHydra - will now be able to properly grab the nzb files, as well as proper logging and handling of Failed downloading, IMP: Duplicate Directory Dump option available in Configuration GUI. Any duplicates discovered during post-processing will be moved into this directory (if enabled) depending on the dupe constraints, FIX: Better handling of titles with '&' and '-' in the titles (as well as annuals) when adding series which should mean more accurate results when trying to add a series, FIX:(#1142) If files didn't have the pages field metadata within the comicinfo.xml file, would error out and either fail to display the issue, or fail to scan the issue during an import scan, FIX: When adding/refreshing a series, if the cover image from CV is unable to be retrieved or is not of an adequate size, fallback to a differnt quality image from CV, FIX: When refreshing/adding a series, annuals will only be checked against once (it was previously running through the entire annual check twice), FIX: During RSS scans/checks if a title in the results had an encoded & (&), would store it as the html which would never match up when doing actual comparison searches, IMP: Fixed usage of feedparser module in rss feeds so that it only uses the retrieved data and doesn't do the actual polling against the url (requests module now does), IMP: Added proper handling of error code 910 with dognzb (max api hits), so that once it hits the 910 error it will disable dognzb as a provider, FIX: When attempting to display issue details on a series detail page (the i icon in the issues table), if the metadata in the .cbz cannot be read or doesn't exist, will now display a graphical warning instead of a 500 error, IMP: Added fork/fork version/tag to comictagger user-agent/version, IMP: Removed configparser dependency from ComicTagger, FIX: When performing searches, improved volume label matching regardless of how the volume label is represented
2016-03-04 20:04:19 +00:00
#& have been brought into the title field incorretly occassionally - patched now, but to include those entries already in the
#cache db that have the incorrect entry, we'll adjust.
torTITLE = re . sub ( ' & ' , ' & ' , tor [ ' Title ' ] ) . strip ( )
FIX: When retrieving feeds from 32p and in Auth mode, personal notification feeds contained some invalid html entries that weren't removed properly resulting in no results when attempting to match for downloading, FIX: When searching 32P, if title had a '/' within the title - Mylar would mistakingly skip it due to some previous exceptions that were made for CBT, FIX: Main page would quickly display & hide the have% column instead of always being hidden, FIX: Adjusted some incorrect spacing for non-alphanumeric characters when comparing search results (should result in better matching hopefully), FIX: When adding a series and the most recent issue was present on the weekly-pull list, it would sometimes not mark it as Wanted and auto-attempt to search for it (if auto mark Upcoming enabled), FIX: Added Test Connection button for 32P where it will test logon credentials as well as if Captcha is present, IMP: If captcha is enabled for 32p and signon is required because keys are stale, will not send authentication information and will just bypass as a provider, IMP: Test Connection button added for SABnzbd, IMP: Added ability to directly add torrents to rtorrent and apply label + download directory options (config.ini only atm), FIX: If a search result had a 'vol.' label in it, depending on how the format of the label was mylar would refuse to remove the volume which resulted in failed matches (also fixed a similar issue with failing to remove the volume label when comparing search results), FIX: When filechecking, if a series had a - in the title, will now account for it properly, IMP: Completely redid the filecheck module which allows for integration into other modules as well as more detailed failure logs, IMP: Added Dynamic handder integration into filechecker and subsequent modules that use it which allows for special characters to be replaced with any other type of character, IMP: Manual post-processing speed improved greatly due to new usage of filecheck module, IMP: Importer backend code redone to include new filecheck module, IMP: Added status/counter to import process, IMP: Added force unlock option to importer for failed imports, IMP: Added new status to Import labelled as 'Manual Intervention' for imports that need the user to manually select an option from an available list, FIX: When import said there were search results to view, but none available - would blank screen, IMP: Added a failure log entry showing all the failed files that weren't able to be scanned in during an import (will be in GUI eventually), IMP: if only partial metadata is available during import, Mylar will attempt to use what's available from the metatagging instead of picking all of one/other, IMP: Better grouping of series/volumes when viewing the import results page as well as now indicating if annuals are present within the files, IMP: Added a file-icon beside each imported item on the import result page which allows the user to view the files that are associated with the given series grouping, IMP: Added a blacklisted_publishers option to config.ini which will blacklist specific publishers from being returned during search / import results, FIX: If duplicate dump folder had a value, but duplicate dump wasn't enabled - would still use the duplicate dump folder during post-processing runs, FIX: (#1194) Patch to allow for fixed H1 elements for title (thnx chazlarson), FIX: Removed UnRAR dependency checks in cmtagmylar since not being used anymore, FIX: Fixed a problem with non-ascii characters being recognized during a file-check in certain cases, IMP: Attmept by Mylar to grab an alternate jpg from file when viewing the issue details if it complies with the naming conventions, FIX: Fixed some metatagging issues with ComicBookLover tags not being handled properly if they didn't exist, IMP: Dupecheck now has a failback if it's comparing a cbr/cbr, cbz/cbz and cbr/cbz-priority is enabled, FIX: Quick check added for when adding/refreshing a comic that if a cover already existed, it would delete the cover prior to the attempt to retrieve it, IMP: Added some additional handling for when searching/adding fails, FIX: If a story arc didn't have proper issue dates (or invalid ones) would error out on loading the story arc main page - usually when arcs were imported using a cbl file.
2016-04-07 17:09:06 +00:00
#torsplit = torTITLE.split(' ')
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . PREFERRED_QUALITY == 1 :
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
if ' cbr ' not in torTITLE :
#logger.fdebug('Quality restriction enforced [ cbr only ]. Rejecting result.')
FIX: When retrieving feeds from 32p and in Auth mode, personal notification feeds contained some invalid html entries that weren't removed properly resulting in no results when attempting to match for downloading, FIX: When searching 32P, if title had a '/' within the title - Mylar would mistakingly skip it due to some previous exceptions that were made for CBT, FIX: Main page would quickly display & hide the have% column instead of always being hidden, FIX: Adjusted some incorrect spacing for non-alphanumeric characters when comparing search results (should result in better matching hopefully), FIX: When adding a series and the most recent issue was present on the weekly-pull list, it would sometimes not mark it as Wanted and auto-attempt to search for it (if auto mark Upcoming enabled), FIX: Added Test Connection button for 32P where it will test logon credentials as well as if Captcha is present, IMP: If captcha is enabled for 32p and signon is required because keys are stale, will not send authentication information and will just bypass as a provider, IMP: Test Connection button added for SABnzbd, IMP: Added ability to directly add torrents to rtorrent and apply label + download directory options (config.ini only atm), FIX: If a search result had a 'vol.' label in it, depending on how the format of the label was mylar would refuse to remove the volume which resulted in failed matches (also fixed a similar issue with failing to remove the volume label when comparing search results), FIX: When filechecking, if a series had a - in the title, will now account for it properly, IMP: Completely redid the filecheck module which allows for integration into other modules as well as more detailed failure logs, IMP: Added Dynamic handder integration into filechecker and subsequent modules that use it which allows for special characters to be replaced with any other type of character, IMP: Manual post-processing speed improved greatly due to new usage of filecheck module, IMP: Importer backend code redone to include new filecheck module, IMP: Added status/counter to import process, IMP: Added force unlock option to importer for failed imports, IMP: Added new status to Import labelled as 'Manual Intervention' for imports that need the user to manually select an option from an available list, FIX: When import said there were search results to view, but none available - would blank screen, IMP: Added a failure log entry showing all the failed files that weren't able to be scanned in during an import (will be in GUI eventually), IMP: if only partial metadata is available during import, Mylar will attempt to use what's available from the metatagging instead of picking all of one/other, IMP: Better grouping of series/volumes when viewing the import results page as well as now indicating if annuals are present within the files, IMP: Added a file-icon beside each imported item on the import result page which allows the user to view the files that are associated with the given series grouping, IMP: Added a blacklisted_publishers option to config.ini which will blacklist specific publishers from being returned during search / import results, FIX: If duplicate dump folder had a value, but duplicate dump wasn't enabled - would still use the duplicate dump folder during post-processing runs, FIX: (#1194) Patch to allow for fixed H1 elements for title (thnx chazlarson), FIX: Removed UnRAR dependency checks in cmtagmylar since not being used anymore, FIX: Fixed a problem with non-ascii characters being recognized during a file-check in certain cases, IMP: Attmept by Mylar to grab an alternate jpg from file when viewing the issue details if it complies with the naming conventions, FIX: Fixed some metatagging issues with ComicBookLover tags not being handled properly if they didn't exist, IMP: Dupecheck now has a failback if it's comparing a cbr/cbr, cbz/cbz and cbr/cbz-priority is enabled, FIX: Quick check added for when adding/refreshing a comic that if a cover already existed, it would delete the cover prior to the attempt to retrieve it, IMP: Added some additional handling for when searching/adding fails, FIX: If a story arc didn't have proper issue dates (or invalid ones) would error out on loading the story arc main page - usually when arcs were imported using a cbl file.
2016-04-07 17:09:06 +00:00
continue
2017-10-25 18:33:56 +00:00
elif mylar . CONFIG . PREFERRED_QUALITY == 2 :
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
if ' cbz ' not in torTITLE :
#logger.fdebug('Quality restriction enforced [ cbz only ]. Rejecting result.')
FIX: When retrieving feeds from 32p and in Auth mode, personal notification feeds contained some invalid html entries that weren't removed properly resulting in no results when attempting to match for downloading, FIX: When searching 32P, if title had a '/' within the title - Mylar would mistakingly skip it due to some previous exceptions that were made for CBT, FIX: Main page would quickly display & hide the have% column instead of always being hidden, FIX: Adjusted some incorrect spacing for non-alphanumeric characters when comparing search results (should result in better matching hopefully), FIX: When adding a series and the most recent issue was present on the weekly-pull list, it would sometimes not mark it as Wanted and auto-attempt to search for it (if auto mark Upcoming enabled), FIX: Added Test Connection button for 32P where it will test logon credentials as well as if Captcha is present, IMP: If captcha is enabled for 32p and signon is required because keys are stale, will not send authentication information and will just bypass as a provider, IMP: Test Connection button added for SABnzbd, IMP: Added ability to directly add torrents to rtorrent and apply label + download directory options (config.ini only atm), FIX: If a search result had a 'vol.' label in it, depending on how the format of the label was mylar would refuse to remove the volume which resulted in failed matches (also fixed a similar issue with failing to remove the volume label when comparing search results), FIX: When filechecking, if a series had a - in the title, will now account for it properly, IMP: Completely redid the filecheck module which allows for integration into other modules as well as more detailed failure logs, IMP: Added Dynamic handder integration into filechecker and subsequent modules that use it which allows for special characters to be replaced with any other type of character, IMP: Manual post-processing speed improved greatly due to new usage of filecheck module, IMP: Importer backend code redone to include new filecheck module, IMP: Added status/counter to import process, IMP: Added force unlock option to importer for failed imports, IMP: Added new status to Import labelled as 'Manual Intervention' for imports that need the user to manually select an option from an available list, FIX: When import said there were search results to view, but none available - would blank screen, IMP: Added a failure log entry showing all the failed files that weren't able to be scanned in during an import (will be in GUI eventually), IMP: if only partial metadata is available during import, Mylar will attempt to use what's available from the metatagging instead of picking all of one/other, IMP: Better grouping of series/volumes when viewing the import results page as well as now indicating if annuals are present within the files, IMP: Added a file-icon beside each imported item on the import result page which allows the user to view the files that are associated with the given series grouping, IMP: Added a blacklisted_publishers option to config.ini which will blacklist specific publishers from being returned during search / import results, FIX: If duplicate dump folder had a value, but duplicate dump wasn't enabled - would still use the duplicate dump folder during post-processing runs, FIX: (#1194) Patch to allow for fixed H1 elements for title (thnx chazlarson), FIX: Removed UnRAR dependency checks in cmtagmylar since not being used anymore, FIX: Fixed a problem with non-ascii characters being recognized during a file-check in certain cases, IMP: Attmept by Mylar to grab an alternate jpg from file when viewing the issue details if it complies with the naming conventions, FIX: Fixed some metatagging issues with ComicBookLover tags not being handled properly if they didn't exist, IMP: Dupecheck now has a failback if it's comparing a cbr/cbr, cbz/cbz and cbr/cbz-priority is enabled, FIX: Quick check added for when adding/refreshing a comic that if a cover already existed, it would delete the cover prior to the attempt to retrieve it, IMP: Added some additional handling for when searching/adding fails, FIX: If a story arc didn't have proper issue dates (or invalid ones) would error out on loading the story arc main page - usually when arcs were imported using a cbl file.
2016-04-07 17:09:06 +00:00
continue
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
#logger.fdebug('tor-Title: ' + torTITLE)
FIX: When retrieving feeds from 32p and in Auth mode, personal notification feeds contained some invalid html entries that weren't removed properly resulting in no results when attempting to match for downloading, FIX: When searching 32P, if title had a '/' within the title - Mylar would mistakingly skip it due to some previous exceptions that were made for CBT, FIX: Main page would quickly display & hide the have% column instead of always being hidden, FIX: Adjusted some incorrect spacing for non-alphanumeric characters when comparing search results (should result in better matching hopefully), FIX: When adding a series and the most recent issue was present on the weekly-pull list, it would sometimes not mark it as Wanted and auto-attempt to search for it (if auto mark Upcoming enabled), FIX: Added Test Connection button for 32P where it will test logon credentials as well as if Captcha is present, IMP: If captcha is enabled for 32p and signon is required because keys are stale, will not send authentication information and will just bypass as a provider, IMP: Test Connection button added for SABnzbd, IMP: Added ability to directly add torrents to rtorrent and apply label + download directory options (config.ini only atm), FIX: If a search result had a 'vol.' label in it, depending on how the format of the label was mylar would refuse to remove the volume which resulted in failed matches (also fixed a similar issue with failing to remove the volume label when comparing search results), FIX: When filechecking, if a series had a - in the title, will now account for it properly, IMP: Completely redid the filecheck module which allows for integration into other modules as well as more detailed failure logs, IMP: Added Dynamic handder integration into filechecker and subsequent modules that use it which allows for special characters to be replaced with any other type of character, IMP: Manual post-processing speed improved greatly due to new usage of filecheck module, IMP: Importer backend code redone to include new filecheck module, IMP: Added status/counter to import process, IMP: Added force unlock option to importer for failed imports, IMP: Added new status to Import labelled as 'Manual Intervention' for imports that need the user to manually select an option from an available list, FIX: When import said there were search results to view, but none available - would blank screen, IMP: Added a failure log entry showing all the failed files that weren't able to be scanned in during an import (will be in GUI eventually), IMP: if only partial metadata is available during import, Mylar will attempt to use what's available from the metatagging instead of picking all of one/other, IMP: Better grouping of series/volumes when viewing the import results page as well as now indicating if annuals are present within the files, IMP: Added a file-icon beside each imported item on the import result page which allows the user to view the files that are associated with the given series grouping, IMP: Added a blacklisted_publishers option to config.ini which will blacklist specific publishers from being returned during search / import results, FIX: If duplicate dump folder had a value, but duplicate dump wasn't enabled - would still use the duplicate dump folder during post-processing runs, FIX: (#1194) Patch to allow for fixed H1 elements for title (thnx chazlarson), FIX: Removed UnRAR dependency checks in cmtagmylar since not being used anymore, FIX: Fixed a problem with non-ascii characters being recognized during a file-check in certain cases, IMP: Attmept by Mylar to grab an alternate jpg from file when viewing the issue details if it complies with the naming conventions, FIX: Fixed some metatagging issues with ComicBookLover tags not being handled properly if they didn't exist, IMP: Dupecheck now has a failback if it's comparing a cbr/cbr, cbz/cbz and cbr/cbz-priority is enabled, FIX: Quick check added for when adding/refreshing a comic that if a cover already existed, it would delete the cover prior to the attempt to retrieve it, IMP: Added some additional handling for when searching/adding fails, FIX: If a story arc didn't have proper issue dates (or invalid ones) would error out on loading the story arc main page - usually when arcs were imported using a cbl file.
2016-04-07 17:09:06 +00:00
#logger.fdebug('there are ' + str(len(torsplit)) + ' sections in this title')
2013-07-30 04:57:37 +00:00
i = 0
2014-04-20 04:01:23 +00:00
if nzbprov is not None :
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
if nzbprov != tor [ ' Site ' ] and not any ( [ mylar . CONFIG . ENABLE_PUBLIC , tor [ ' Site ' ] != ' WWT ' , tor [ ' Site ' ] != ' DEM ' ] ) :
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
#logger.fdebug('this is a result from ' + str(tor['Site']) + ', not the site I am looking for of ' + str(nzbprov))
2014-04-20 04:01:23 +00:00
continue
2013-07-30 04:57:37 +00:00
#0 holds the title/issue and format-type.
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
2013-08-19 06:14:47 +00:00
seriesname_mod = seriesname
FIX: When retrieving feeds from 32p and in Auth mode, personal notification feeds contained some invalid html entries that weren't removed properly resulting in no results when attempting to match for downloading, FIX: When searching 32P, if title had a '/' within the title - Mylar would mistakingly skip it due to some previous exceptions that were made for CBT, FIX: Main page would quickly display & hide the have% column instead of always being hidden, FIX: Adjusted some incorrect spacing for non-alphanumeric characters when comparing search results (should result in better matching hopefully), FIX: When adding a series and the most recent issue was present on the weekly-pull list, it would sometimes not mark it as Wanted and auto-attempt to search for it (if auto mark Upcoming enabled), FIX: Added Test Connection button for 32P where it will test logon credentials as well as if Captcha is present, IMP: If captcha is enabled for 32p and signon is required because keys are stale, will not send authentication information and will just bypass as a provider, IMP: Test Connection button added for SABnzbd, IMP: Added ability to directly add torrents to rtorrent and apply label + download directory options (config.ini only atm), FIX: If a search result had a 'vol.' label in it, depending on how the format of the label was mylar would refuse to remove the volume which resulted in failed matches (also fixed a similar issue with failing to remove the volume label when comparing search results), FIX: When filechecking, if a series had a - in the title, will now account for it properly, IMP: Completely redid the filecheck module which allows for integration into other modules as well as more detailed failure logs, IMP: Added Dynamic handder integration into filechecker and subsequent modules that use it which allows for special characters to be replaced with any other type of character, IMP: Manual post-processing speed improved greatly due to new usage of filecheck module, IMP: Importer backend code redone to include new filecheck module, IMP: Added status/counter to import process, IMP: Added force unlock option to importer for failed imports, IMP: Added new status to Import labelled as 'Manual Intervention' for imports that need the user to manually select an option from an available list, FIX: When import said there were search results to view, but none available - would blank screen, IMP: Added a failure log entry showing all the failed files that weren't able to be scanned in during an import (will be in GUI eventually), IMP: if only partial metadata is available during import, Mylar will attempt to use what's available from the metatagging instead of picking all of one/other, IMP: Better grouping of series/volumes when viewing the import results page as well as now indicating if annuals are present within the files, IMP: Added a file-icon beside each imported item on the import result page which allows the user to view the files that are associated with the given series grouping, IMP: Added a blacklisted_publishers option to config.ini which will blacklist specific publishers from being returned during search / import results, FIX: If duplicate dump folder had a value, but duplicate dump wasn't enabled - would still use the duplicate dump folder during post-processing runs, FIX: (#1194) Patch to allow for fixed H1 elements for title (thnx chazlarson), FIX: Removed UnRAR dependency checks in cmtagmylar since not being used anymore, FIX: Fixed a problem with non-ascii characters being recognized during a file-check in certain cases, IMP: Attmept by Mylar to grab an alternate jpg from file when viewing the issue details if it complies with the naming conventions, FIX: Fixed some metatagging issues with ComicBookLover tags not being handled properly if they didn't exist, IMP: Dupecheck now has a failback if it's comparing a cbr/cbr, cbz/cbz and cbr/cbz-priority is enabled, FIX: Quick check added for when adding/refreshing a comic that if a cover already existed, it would delete the cover prior to the attempt to retrieve it, IMP: Added some additional handling for when searching/adding fails, FIX: If a story arc didn't have proper issue dates (or invalid ones) would error out on loading the story arc main page - usually when arcs were imported using a cbl file.
2016-04-07 17:09:06 +00:00
foundname_mod = torTITLE #torsplit[0]
2013-08-19 06:14:47 +00:00
seriesname_mod = re . sub ( " \\ band \\ b " , " " , seriesname_mod . lower ( ) )
foundname_mod = re . sub ( " \\ band \\ b " , " " , foundname_mod . lower ( ) )
seriesname_mod = re . sub ( " \\ bthe \\ b " , " " , seriesname_mod . lower ( ) )
foundname_mod = re . sub ( " \\ bthe \\ b " , " " , foundname_mod . lower ( ) )
seriesname_mod = re . sub ( ' [ \ &] ' , ' ' , seriesname_mod )
foundname_mod = re . sub ( ' [ \ &] ' , ' ' , foundname_mod )
2017-02-11 23:57:19 +00:00
formatrem_seriesname = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ ; \ = \ ? \ . \ ,] ' , ' ' , seriesname_mod )
2015-05-22 08:32:51 +00:00
formatrem_seriesname = re . sub ( ' [ \ -] ' , ' ' , formatrem_seriesname )
2014-06-11 18:39:50 +00:00
formatrem_seriesname = re . sub ( ' [ \ /] ' , ' ' , formatrem_seriesname ) #not necessary since seriesname in a torrent file won't have /
2013-08-19 06:14:47 +00:00
formatrem_seriesname = re . sub ( ' \ s+ ' , ' ' , formatrem_seriesname )
if formatrem_seriesname [ : 1 ] == ' ' : formatrem_seriesname = formatrem_seriesname [ 1 : ]
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
2017-02-11 23:57:19 +00:00
formatrem_torsplit = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ ; \\ = \ ? \ . \ ,] ' , ' ' , foundname_mod )
2015-05-22 08:32:51 +00:00
formatrem_torsplit = re . sub ( ' [ \ -] ' , ' ' , formatrem_torsplit ) #we replace the - with space so we'll get hits if differnces
2014-06-11 18:39:50 +00:00
formatrem_torsplit = re . sub ( ' [ \ /] ' , ' ' , formatrem_torsplit ) #not necessary since if has a /, should be removed in above line
2013-07-30 04:57:37 +00:00
formatrem_torsplit = re . sub ( ' \ s+ ' , ' ' , formatrem_torsplit )
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
#logger.fdebug(str(len(formatrem_torsplit)) + ' - formatrem_torsplit : ' + formatrem_torsplit.lower())
#logger.fdebug(str(len(formatrem_seriesname)) + ' - formatrem_seriesname :' + formatrem_seriesname.lower())
2013-08-19 06:14:47 +00:00
2013-08-11 05:31:41 +00:00
if formatrem_seriesname . lower ( ) in formatrem_torsplit . lower ( ) or any ( x . lower ( ) in formatrem_torsplit . lower ( ) for x in AS_Alt ) :
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
#logger.fdebug('matched to : ' + torTITLE)
#logger.fdebug('matched on series title: ' + seriesname)
2013-07-30 04:57:37 +00:00
titleend = formatrem_torsplit [ len ( formatrem_seriesname ) : ]
titleend = re . sub ( ' \ - ' , ' ' , titleend ) #remove the '-' which is unnecessary
2014-01-16 20:25:02 +00:00
#remove extensions
FIX: (#746) updated autoProcessComics.py / ComicRN.py's which will now send proper completion messeages to clients, FIX: (#752) refresh series will now test if a series is 'out of whack' with it's numerical issue count (ie. 5/4) or it has no issue data due to a bad refresh / api maxing out and will adjust it's processing to accomodate either, IMP: (#750) Added ComicVine API Checker which will check API counts at regular intervals to inform/warn users of usage, as well as adding a screen-time display of API hits / mins used at the bottom of every page (refreshing/reloading pages will update counts), FIX: (#747)EOL normalization (dos2unix) on search.py - removed classes & exceptions as not being used, IMP: (#747) Skip processing issues with an invalid store date & issue date (thnx rupaschomaker), FIX: Removed strings when searching/logging torrents as was causing ascii errors especially with KAT, IMP: Added [META-TAGGING] to logging for meta-tagging module, IMP: Added ability in GUI to select CR or Cbl tags (or both) when writing metadata to cbz files, IMP: Improved support/usage with ComicTagger v1.1.15 which allows for personal CV API Key usage - if supplied to Mylar, will use when tagging with ComicTagger, IMP: Added Manual Search option to allow for individual searches of issues without changing initial status.
2014-06-18 19:58:19 +00:00
titleend = re . sub ( ' cbr ' , ' ' , titleend )
titleend = re . sub ( ' cbz ' , ' ' , titleend )
titleend = re . sub ( ' none ' , ' ' , titleend )
FIX:(#1905) Unicode errors when logging and system language is not a subset of english, IMP: Added post-processing queue (currently just for forceProcess api, but will be used by default for all post-processing actions soon), IMP: Multiple Torznab support added, IMP: Logging values for number of files and size/file added to config, IMP: Pushover notifications can be sent to specific device now, IMP: Added nzbget, newznab, nzb.su and dognzb test options, IMP: Added graphical checkmark/x when performing various tests (providers, downloaders, notifiers) within configuration, IMP: Removed some more unnecessary logging lines from searches
2018-04-06 17:46:39 +00:00
#logger.fdebug('titleend: ' + titleend)
2014-01-16 20:25:02 +00:00
2013-07-30 04:57:37 +00:00
sptitle = titleend . split ( )
extra = ' '
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
2013-08-04 05:57:21 +00:00
tortheinfo . append ( {
FIX: When retrieving feeds from 32p and in Auth mode, personal notification feeds contained some invalid html entries that weren't removed properly resulting in no results when attempting to match for downloading, FIX: When searching 32P, if title had a '/' within the title - Mylar would mistakingly skip it due to some previous exceptions that were made for CBT, FIX: Main page would quickly display & hide the have% column instead of always being hidden, FIX: Adjusted some incorrect spacing for non-alphanumeric characters when comparing search results (should result in better matching hopefully), FIX: When adding a series and the most recent issue was present on the weekly-pull list, it would sometimes not mark it as Wanted and auto-attempt to search for it (if auto mark Upcoming enabled), FIX: Added Test Connection button for 32P where it will test logon credentials as well as if Captcha is present, IMP: If captcha is enabled for 32p and signon is required because keys are stale, will not send authentication information and will just bypass as a provider, IMP: Test Connection button added for SABnzbd, IMP: Added ability to directly add torrents to rtorrent and apply label + download directory options (config.ini only atm), FIX: If a search result had a 'vol.' label in it, depending on how the format of the label was mylar would refuse to remove the volume which resulted in failed matches (also fixed a similar issue with failing to remove the volume label when comparing search results), FIX: When filechecking, if a series had a - in the title, will now account for it properly, IMP: Completely redid the filecheck module which allows for integration into other modules as well as more detailed failure logs, IMP: Added Dynamic handder integration into filechecker and subsequent modules that use it which allows for special characters to be replaced with any other type of character, IMP: Manual post-processing speed improved greatly due to new usage of filecheck module, IMP: Importer backend code redone to include new filecheck module, IMP: Added status/counter to import process, IMP: Added force unlock option to importer for failed imports, IMP: Added new status to Import labelled as 'Manual Intervention' for imports that need the user to manually select an option from an available list, FIX: When import said there were search results to view, but none available - would blank screen, IMP: Added a failure log entry showing all the failed files that weren't able to be scanned in during an import (will be in GUI eventually), IMP: if only partial metadata is available during import, Mylar will attempt to use what's available from the metatagging instead of picking all of one/other, IMP: Better grouping of series/volumes when viewing the import results page as well as now indicating if annuals are present within the files, IMP: Added a file-icon beside each imported item on the import result page which allows the user to view the files that are associated with the given series grouping, IMP: Added a blacklisted_publishers option to config.ini which will blacklist specific publishers from being returned during search / import results, FIX: If duplicate dump folder had a value, but duplicate dump wasn't enabled - would still use the duplicate dump folder during post-processing runs, FIX: (#1194) Patch to allow for fixed H1 elements for title (thnx chazlarson), FIX: Removed UnRAR dependency checks in cmtagmylar since not being used anymore, FIX: Fixed a problem with non-ascii characters being recognized during a file-check in certain cases, IMP: Attmept by Mylar to grab an alternate jpg from file when viewing the issue details if it complies with the naming conventions, FIX: Fixed some metatagging issues with ComicBookLover tags not being handled properly if they didn't exist, IMP: Dupecheck now has a failback if it's comparing a cbr/cbr, cbz/cbz and cbr/cbz-priority is enabled, FIX: Quick check added for when adding/refreshing a comic that if a cover already existed, it would delete the cover prior to the attempt to retrieve it, IMP: Added some additional handling for when searching/adding fails, FIX: If a story arc didn't have proper issue dates (or invalid ones) would error out on loading the story arc main page - usually when arcs were imported using a cbl file.
2016-04-07 17:09:06 +00:00
' title ' : torTITLE , #cttitle,
2013-08-04 05:57:21 +00:00
' link ' : tor [ ' Link ' ] ,
' pubdate ' : tor [ ' Pubdate ' ] ,
' site ' : tor [ ' Site ' ] ,
' length ' : tor [ ' Size ' ]
} )
2013-07-30 04:57:37 +00:00
torinfo [ ' entries ' ] = tortheinfo
return torinfo
FIX:(#1630) One-off issues will now be post-processed according to grab-bag dir location, IMP: One-off pull-list issues will now have the status marked accordingly on weekly pullist for tracking purposes, FIX: Fix for utorrent not being able to update status properly after initial snatch, FIX: Fix for some incorrect variable references due to different snatch methods when trying to run on-snatch scripts, FIX: Fix for auto-torrent-snatcher trying to snatch a torrent with an '&' in the filename, FIX:(#1637) Fix for telegram not saving on snatch toggle properly, IMP: added additional logging for metatagging when attempting to create temp folder in cache location, IMP: will now clean up any left over metagtagging directories that fail during normal post-processing instead of leaving and continuing, FIX: Will notify on one-off grab's/storyarc's being post-processed, FIX: fix for displaying cbz issue details (the 'i' on the comic details page) in which the series title contained non-alphanumeric characters, IMP: Added ability to change status to Wanted on Upcoming tab (will perform an immediate search on selected issues), IMP: Threaded the one-off search call from the weeklypull
2017-06-02 14:05:06 +00:00
def nzbdbsearch ( seriesname , issue , comicid = None , nzbprov = None , searchYear = None , ComicVersion = None , oneoff = False ) :
2013-07-30 04:57:37 +00:00
myDB = db . DBConnection ( )
seriesname_alt = None
FIX:(#1630) One-off issues will now be post-processed according to grab-bag dir location, IMP: One-off pull-list issues will now have the status marked accordingly on weekly pullist for tracking purposes, FIX: Fix for utorrent not being able to update status properly after initial snatch, FIX: Fix for some incorrect variable references due to different snatch methods when trying to run on-snatch scripts, FIX: Fix for auto-torrent-snatcher trying to snatch a torrent with an '&' in the filename, FIX:(#1637) Fix for telegram not saving on snatch toggle properly, IMP: added additional logging for metatagging when attempting to create temp folder in cache location, IMP: will now clean up any left over metagtagging directories that fail during normal post-processing instead of leaving and continuing, FIX: Will notify on one-off grab's/storyarc's being post-processed, FIX: fix for displaying cbz issue details (the 'i' on the comic details page) in which the series title contained non-alphanumeric characters, IMP: Added ability to change status to Wanted on Upcoming tab (will perform an immediate search on selected issues), IMP: Threaded the one-off search call from the weeklypull
2017-06-02 14:05:06 +00:00
if any ( [ comicid is None , comicid == ' None ' , oneoff is True ] ) :
2013-07-30 04:57:37 +00:00
pass
else :
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
snm = myDB . selectone ( " SELECT * FROM comics WHERE comicid=? " , [ comicid ] ) . fetchone ( )
2013-07-30 04:57:37 +00:00
if snm is None :
2013-08-19 06:14:47 +00:00
logger . info ( ' Invalid ComicID of ' + str ( comicid ) + ' . Aborting search. ' )
2013-07-30 04:57:37 +00:00
return
else :
seriesname = snm [ ' ComicName ' ]
seriesname_alt = snm [ ' AlternateSearch ' ]
2015-05-22 08:32:51 +00:00
nsearch_seriesname = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ ; \ / \\ = \ ? \ . \ - \ s] ' , ' % ' , seriesname )
formatrem_seriesname = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ ; \ / \\ = \ ? \ .] ' , ' ' , seriesname )
2014-12-01 17:23:49 +00:00
2013-12-03 19:04:38 +00:00
nsearch = ' % ' + nsearch_seriesname + " % "
2014-12-01 17:23:49 +00:00
2015-05-22 08:32:51 +00:00
nresults = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site=? " , [ nsearch , nzbprov ] )
2013-07-30 04:57:37 +00:00
if nresults is None :
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' nzb search returned no results for ' + seriesname )
2013-07-30 04:57:37 +00:00
if seriesname_alt is None :
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' no nzb Alternate name given. Aborting search. ' )
2013-07-30 04:57:37 +00:00
return " no results "
else :
chkthealt = seriesname_alt . split ( ' ## ' )
if chkthealt == 0 :
AS_Alternate = AlternateSearch
for calt in chkthealt :
2015-05-22 08:32:51 +00:00
AS_Alternate = re . sub ( ' ## ' , ' ' , calt )
2014-12-01 17:23:49 +00:00
AS_Alternate = ' % ' + AS_Alternate + " % "
2015-05-22 08:32:51 +00:00
nresults + = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site=? " , [ AS_Alternate , nzbprov ] )
2013-07-30 04:57:37 +00:00
if nresults is None :
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' nzb alternate name search returned no results. ' )
2013-07-30 04:57:37 +00:00
return " no results "
nzbtheinfo = [ ]
nzbinfo = { }
2013-12-03 19:04:38 +00:00
if nzbprov == ' experimental ' :
except_list = [ ' releases ' , ' gold line ' , ' distribution ' , ' 0-day ' , ' 0 day ' ]
if ComicVersion :
ComVersChk = re . sub ( " [^0-9] " , " " , ComicVersion )
if ComVersChk == ' ' :
ComVersChk = 0
else :
ComVersChk = 0
else :
ComVersChk = 0
2014-12-01 17:23:49 +00:00
filetype = None
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . PREFERRED_QUALITY == 1 : filetype = ' cbr '
elif mylar . CONFIG . PREFERRED_QUALITY == 2 : filetype = ' cbz '
2015-05-22 08:32:51 +00:00
2013-12-03 19:04:38 +00:00
for results in nresults :
title = results [ ' Title ' ]
#logger.fdebug("titlesplit: " + str(title.split("\"")))
splitTitle = title . split ( " \" " )
noYear = ' False '
2014-12-01 17:23:49 +00:00
_digits = re . compile ( ' \ d ' )
2013-12-03 19:04:38 +00:00
for subs in splitTitle :
#logger.fdebug(subs)
2014-12-01 17:23:49 +00:00
if len ( subs ) > = len ( seriesname ) and not any ( d in subs . lower ( ) for d in except_list ) and bool ( _digits . search ( subs ) ) is True :
if subs . lower ( ) . startswith ( ' for ' ) :
# need to filter down alternate names in here at some point...
if seriesname . lower ( ) . startswith ( ' for ' ) :
pass
else :
#this is the crap we ignore. Continue
logger . fdebug ( ' this starts with FOR : ' + str ( subs ) + ' . This is not present in the series - ignoring. ' )
continue
2013-12-03 19:04:38 +00:00
if ComVersChk == 0 :
noYear = ' False '
if ComVersChk != 0 and searchYear not in subs :
noYear = ' True '
noYearline = subs
if searchYear in subs and noYear == ' True ' :
#this would occur on the next check in the line, if year exists and
#the noYear check in the first check came back valid append it
subs = noYearline + ' ( ' + searchYear + ' ) '
noYear = ' False '
if noYear == ' False ' :
2014-12-01 17:23:49 +00:00
if filetype is not None :
if filetype not in subs . lower ( ) :
continue
2013-12-03 19:04:38 +00:00
nzbtheinfo . append ( {
' title ' : subs ,
' link ' : re . sub ( ' \ /release \ / ' , ' /download/ ' , results [ ' Link ' ] ) ,
' pubdate ' : str ( results [ ' PubDate ' ] ) ,
' site ' : str ( results [ ' Site ' ] ) ,
' length ' : str ( results [ ' Size ' ] ) } )
else :
for nzb in nresults :
# no need to parse here, just compile and throw it back ....
nzbtheinfo . append ( {
' title ' : nzb [ ' Title ' ] ,
' link ' : nzb [ ' Link ' ] ,
' pubdate ' : nzb [ ' Pubdate ' ] ,
' site ' : nzb [ ' Site ' ] ,
' length ' : nzb [ ' Size ' ]
} )
IMP: Ability to now specify search provider order (regardless of torrents or nzb) within the config.ini, IMP: (#667) Changed the db module to try to accomodate db locking errors and lowering the amount of actual write transactions that were committed along with a new scheduler system, IMP: Changed sabnzbd directory to post-processing, and included subdirs for sabnzbd & nzbget ComicRN scripts, IMP: NZBGet Post-Processing ComicRN.py script (updated for use with nzbget v11.0+)added & updated in post-processing/nzbget directory (thnx ministoat), FIX: If Issue Location was None, and status was Downloaded would cause error in GUI and break series, IMP: (#689) Minimum # of seeders added (will work with KAT), IMP: (#680) Added Boxcar 2 IO Notifications, IMP: Added PushBullet Notifications, IMP: Cleaned up some notification messages so it's not so cluttered, IMP: Added Clickable series link in History tab, IMP: Added Post-Processed as a status to History tab to show manually post-processed items, IMP: Removed log level dropdown from Logs page & added 'ThreadName' as a column, IMP: Added Force Check Availability & View Future Pull-list to Upcoming sub-tabs, IMP: Added '--safe' option to startup options which will redirect directly to Manage Comics screen incase things are broken, FIX: Added proper month conversions for manual post-processing when doing comparitive issue analysis for matches, FIX: (#613) Allow for negative issue numbers in post-processing when renaming and issue padding is enabled, FIX: File Permissions on post-processing would stop post-processing if couldn't change, now will just log the error and continue, IMP: Added Scheduler (from sickbeard) to allow for threadnaming and better scheduling, IMP: Filenames in the format of ' () ' will now get scanned in, IMP: During manual post-processing will now stop looking for matches upon a successful match, IMP: A Refresh/Weeklypull series check will now just scan in issue data, instead of series info,etc, IMP: Removed some legacy GCD code that is no longer in use, IMP: Exception/traceback handling will now be logged, FIX: Unable to grab torrents from KAT due to content-encoding detection failing, IMP: Added universal date-time conversion to allow for non-english based dates to be properly compared when checking search results against publication dates, FIX: Annuals will now get proper notification (prior was leaving out the word 'annual' from notification/logs), IMP: Improved future pull-list detection and increased retension (now ~5 months), IMP: Will now mark new issues as Wanted on a Refresh Series if autowant upcoming is enabled (was reverting to a status of None previously), IMP: Cannot change status to Downloaded if current status is Skipped or Wanted, FIX: (#704) UnSkipped will now work (X in options column on comic details page), IMP: future_check will check upcoming future issues (future pull-list) that have no series data yet (ie. #1's) and auto-add them to watchlist when the data is available and auto-want accordingly, IMP: (#706) Downloading issues to local machine (via comicdetails screen) with special characters in filename now will work, IMP: improved comparison checks during weekly pull list and improved speed abit since only refreshing issue data now instead of entire series, Other Referenced issues: (#670)(#690) and some others....
2014-05-25 18:32:11 +00:00
#logger.fdebug("entered info for " + nzb['Title'])
2013-12-03 19:04:38 +00:00
2013-07-30 04:57:37 +00:00
nzbinfo [ ' entries ' ] = nzbtheinfo
return nzbinfo
2015-05-22 08:32:51 +00:00
IMP:New scheduler tab (Manage / Activity) where you can see job current run status', next runtime, and prev runtimes as well as force/pause a job, FIX: Disabling
torrents will now properly hide torrent information, IMP: Specified daemon port for deluge as an on-screen tip for more detail, IMP: Added 100,200,ALL as viewable
watchlist views, FIX: When viewing pullist and annual integration enabled, if annual was present would incorrectly link to invalid annual series instead of the
actual series itself, IMP: Added more detail error messages to metatagging errors and better handling of stranded files during cleanup, IMP: Improved some handling for weekly pull-list one-off's and refactored the
nzb/oneoff post-processing into a seperate function for future callables, Moved all the main url locations for public torrent sites to the init module so that it
can be cascaded down for use in other modules instead as a global, IMP: Added a 'deep_search_32p' variable in the config.ini for specific usage with 32p, where
if there is more than one result will dig deeper into each result to try and figure out if there are series matches, as opposed to the default where it will only use ref32p
table if available or just the first hit in a multiple series search results and ignore the remainder, FIX:Fixed some unknown characters appearing in the pullist due
to unicode-related conversion problems, FIX: fixed some special cases of file parsing errors due to Volume label being named different than expected, FIX: Added a
3s pause between experimental searches to try and not hit their frequency limitation, IMP: Weekly Pullist One-off's will now show status of Snatched/Downloaded as
required, FIX: Fixed some deluge parameter problems when using auto-snatch torrent script/option, IMP: Changed the downlocation in the auto-snatch option to an
env variable instead of being passed to avoid unicode-related problems, FIX: Fixed some magnet-related issues for torrents when using a watchdir + TPSE, FIX: Added
more verbose error message for rtorrent connection issues, FIX: Could not connect to rtorrent client if no username/password were provided, IMP: Set the db updater to run
every 5 minutes on the watchlist, automatically refreshing the oldest updated series each time that is more than 5 hours old (force db update from the activity/job schedulers page will run the db updater
against the entire watchlist in sequence), IMP: Attempt to handle long paths in windows (ie. > 256c) by prepending the unicode windows api character to the import
a directory path (windows only), IMP: When manual metatagging a series, will update the series after all the metatagging has been completed as opposed to after each
issue, IMP: Will now display available inkdrops on Config/Search Providers tab when using 32P (future will utilize/indicate inkdrop threshold when downloading)
2017-09-10 15:50:08 +00:00
def torsend2client ( seriesname , issue , seriesyear , linkit , site , pubhash = None ) :
2015-01-25 02:26:22 +00:00
logger . info ( ' matched on ' + seriesname )
filename = helpers . filesafe ( seriesname )
IMP: Added ForceRSS Check and Test SABnzbd Connection buttons in Config, FIX: If Annuals not enabled, would error on home screen, IMP: updated mylar.init.d (thnx Kalinon), FIX: Manual Post-Processing fix for Manual Run (thnx Kalinon), IMP: Library Monitor working (check folder every X minutes and Post-Process), IMP: Future Upcoming introduction, IMP: Experimental search better handling of year inclusions, FIX: Filechecker will now pick up series with years in the series title accordingly, FIX: Torrent seedbox sending would lockup occassionally when attempting to send torrent file, FIX: malformed image url on some series, IMP: Moved issue updating to a seperate function, IMP: When series was refreshed, would download the last issue (or few issues depending on date), regardless of status, IMP: When series is volume 1 or volume label doesn't exist, either assume V1 or remove volume requirements to improve matching hits, IMP: StoryArcs will now check in StoryArc folder for existing issues and change status in StoryArc accordingly...
2013-11-28 15:48:59 +00:00
filename = re . sub ( ' ' , ' _ ' , filename )
2013-10-19 01:04:16 +00:00
filename + = " _ " + str ( issue ) + " _ " + str ( seriesyear )
2013-07-30 04:57:37 +00:00
2016-08-20 21:56:30 +00:00
if linkit [ - 7 : ] != " torrent " :
2013-07-30 04:57:37 +00:00
filename + = " .torrent "
2017-04-28 06:12:45 +00:00
if any ( [ mylar . USE_UTORRENT , mylar . USE_RTORRENT , mylar . USE_TRANSMISSION , mylar . USE_DELUGE , mylar . USE_QBITTORRENT ] ) :
2017-10-25 18:33:56 +00:00
filepath = os . path . join ( mylar . CONFIG . CACHE_DIR , filename )
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' filename for torrent set to : ' + filepath )
2017-09-06 01:27:54 +00:00
2016-05-11 13:59:32 +00:00
elif mylar . USE_WATCHDIR :
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . TORRENT_LOCAL and mylar . CONFIG . LOCAL_WATCHDIR is not None :
filepath = os . path . join ( mylar . CONFIG . LOCAL_WATCHDIR , filename )
2016-05-11 13:59:32 +00:00
logger . fdebug ( ' filename for torrent set to : ' + filepath )
2017-10-25 18:33:56 +00:00
elif mylar . CONFIG . TORRENT_SEEDBOX and mylar . CONFIG . SEEDBOX_WATCHDIR is not None :
filepath = os . path . join ( mylar . CONFIG . CACHE_DIR , filename )
2016-05-11 13:59:32 +00:00
logger . fdebug ( ' filename for torrent set to : ' + filepath )
else :
logger . error ( ' No Local Watch Directory or Seedbox Watch Directory specified. Set it and try again. ' )
return " fail "
2013-07-30 04:57:37 +00:00
FIX:(#1358) nzbname error when retrieving nzb and assigning filename from WWT tracker, FIX:(#1372)(#1369) Fix for creating series folder when adding a series when series title contains either double quotation marks, or an asterisk, FIX:(#1373) Filechecker would ignore filenames that had the extension captialized, FIX:(#1366) When Comic Publisher is not provided on CV, would error during add, FIX: Attempted fix for unicode characters when importing (series title, filenames), FIX: Removed str references that would cause an error on weekly pull in some instances, FIX: When checking for watched series, if series title being checked against had only one word, would cause a traceback error, FIX: When attempting to retrieve results/torrents from TPSE and was behind cloudflare, would error out, IMP: file-size check now works for 32p feeds, FIX: When pullist issue was marked as Wanted and issue was populated on series detail page, occassionaly would not have the same status of Wanted, FIX: Fixed incorrect placement of Comic Location title in GUI, IMP: Added short description for Search Delay option within GUI, FIX:(#1370) multiple selection from Manage Comics tab (Refresh/Delete/Pause) would only select one item
2016-09-06 15:06:07 +00:00
cf_cookievalue = None
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
if site == ' 32P ' :
url = ' https://32pag.es/torrents.php '
2013-09-05 02:36:41 +00:00
FIX: if 32p was disabled due to inability to signon, would still attempt to retrieve cached result when match occured which would then possibly result in excessive attempted logins, IMP: Added Force Type option to comicdetails page which will allow the type of series to be forced to TPB/GN format if Mylar is unable to decipher it under normal circumstances (doing this will affect how files are parsed for the given series), IMP: TPB/GN File Parser will now account for mutiple issues of the same TPB series within the given directory, IMP: When enabling/disabling Force Type, will rename existing folder to accomodate new naming folder convention if required, IMP: Started to move some of the file rename/manipulation modules into a filer.py module for more consistency, IMP: Added a to Folder Format which when triggered will use the designated Series Type, IMP:(#2130) When importing, option now available for the final series destination path to use the imported path location instead of defaulting to the Comic Location base folder - status will be no longer be Archived in such cases. Will also not show previous imported series on subsequent import runs if the import directory has not changed (thnx @CuddleBear92), IMP: Added the codebase for a Rename Preview option into the mix - GUI available, but not linked, FIX: Removed DEM from RSS scans when Public Torrents option is enabled, FIX:(#2137) When adding series, if series indicated date in a different format other than just numeric, would cause error
2018-12-10 17:27:53 +00:00
if mylar . CONFIG . ENABLE_32P is False :
return " fail "
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . VERIFY_32P == 1 or mylar . CONFIG . VERIFY_32P == True :
2015-06-13 19:49:54 +00:00
verify = True
else :
verify = False
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
2015-06-13 19:49:54 +00:00
logger . fdebug ( ' [32P] Verify SSL set to : ' + str ( verify ) )
2019-02-21 16:40:21 +00:00
if mylar . CONFIG . MODE_32P is False :
2017-10-25 18:33:56 +00:00
if mylar . KEYS_32P is None or mylar . CONFIG . PASSKEY_32P is None :
2015-05-14 16:22:23 +00:00
logger . warn ( ' [32P] Unable to retrieve keys from provided RSS Feed. Make sure you have provided a CURRENT RSS Feed from 32P ' )
mylar . KEYS_32P = helpers . parse_32pfeed ( mylar . FEED_32P )
if mylar . KEYS_32P is None or mylar . KEYS_32P == ' ' :
return " fail "
else :
logger . fdebug ( ' [32P-AUTHENTICATION] 32P (Legacy) Authentication Successful. Re-establishing keys. ' )
mylar . AUTHKEY_32P = mylar . KEYS_32P [ ' authkey ' ]
2015-05-14 09:33:40 +00:00
else :
logger . fdebug ( ' [32P-AUTHENTICATION] 32P (Legacy) Authentication already done. Attempting to use existing keys. ' )
2015-05-14 16:22:23 +00:00
mylar . AUTHKEY_32P = mylar . KEYS_32P [ ' authkey ' ]
2015-05-14 09:33:40 +00:00
else :
2017-10-25 18:33:56 +00:00
if any ( [ mylar . CONFIG . USERNAME_32P is None , mylar . CONFIG . USERNAME_32P == ' ' , mylar . CONFIG . PASSWORD_32P is None , mylar . CONFIG . PASSWORD_32P == ' ' ] ) :
2015-05-14 09:33:40 +00:00
logger . error ( ' [RSS] Unable to sign-on to 32P to validate settings and initiate download sequence. Please enter/check your username password in the configuration. ' )
return " fail "
2017-10-25 18:33:56 +00:00
elif mylar . CONFIG . PASSKEY_32P is None or mylar . AUTHKEY_32P is None or mylar . KEYS_32P is None :
2015-05-14 09:33:40 +00:00
logger . fdebug ( ' [32P-AUTHENTICATION] 32P (Auth Mode) Authentication enabled. Keys have not been established yet, attempting to gather. ' )
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
feed32p = auth32p . info32p ( reauthenticate = True )
feedinfo = feed32p . authenticate ( )
FIX: included version of comictagger should now work with both Windows and *nix based OS' again, IMP: Global Copy/Move option available when performing post-processing, IMP: Added a verbose file-checking option (FOLDER_SCAN_LOG_VERBOSE) - when enabled will log as it currently does during manual post-processing/file-checking runs, when disabled it will not spam the log nearly as much resulting in more readable log files, IMP: Added Verbose debug logging both via startup option(-v), as well as toggle button in Log GUI (from headphones), as well as per-page loading of log file(s) in GUI, FIX: When doing manual post-processing on issues that were in story arcs, will now indicate X story-arc issues were post-processed for better visibility, FIX: Fixed an issue with deleting from the nzblog table when story arc issues were post-processed, IMP: Added WEEKFOLDER_LOC to the config.ini to allow for specification of where the weekly download directories will default to (as opposed to off of ComicLocation root), IMP: Better handling of some special character references in series titles when looking for series on the auto-wanted list, IMP: 32P will now auto-disable provider if logon returns invalid credentials, FIX: When using alt_pull on weekly pull list, xA0 unicode character caused error, FIX: If title had invalid character in filename that was replaced with a character that already existed in the title, would not scan in during file-checking, FIX: When searching for a series (weeklypull-list/add a series), if the title contained 'and' or '&' would return really mixed up results, FIX: When Post-Processing, if filename being processed had special characters (ie. comma) and was different than nzbname, in some cases would fail to find/move issues, IMP: Utilize internal comictagger to convert from cbr/cbz, IMP: Added more checks when post-processing to ensure files are handled correctly, IMP: Added meta-tag reading when importing series/issues - if previously tagged with CT, will reverse look-up the provided IssueID to reference the correct ComicID, IMP: If scanned directory during import contins cvinfo file, use that and force the ComicID to entire directory when importing a series, IMP: Manual meta-tagging issues will no longer create temporary directories and/or create files in the Comic Location root causing problems for some users, FIX: Annuals weren't properly sorted upon loading of comic details page for some series, IMP: Added some extra checks when validating/creating directories, FIX: Fixed a problem when displaying some covers of .cbz files on the comic details page
2016-01-26 07:49:56 +00:00
if feedinfo == " disable " :
FIX: if 32p was disabled due to inability to signon, would still attempt to retrieve cached result when match occured which would then possibly result in excessive attempted logins, IMP: Added Force Type option to comicdetails page which will allow the type of series to be forced to TPB/GN format if Mylar is unable to decipher it under normal circumstances (doing this will affect how files are parsed for the given series), IMP: TPB/GN File Parser will now account for mutiple issues of the same TPB series within the given directory, IMP: When enabling/disabling Force Type, will rename existing folder to accomodate new naming folder convention if required, IMP: Started to move some of the file rename/manipulation modules into a filer.py module for more consistency, IMP: Added a to Folder Format which when triggered will use the designated Series Type, IMP:(#2130) When importing, option now available for the final series destination path to use the imported path location instead of defaulting to the Comic Location base folder - status will be no longer be Archived in such cases. Will also not show previous imported series on subsequent import runs if the import directory has not changed (thnx @CuddleBear92), IMP: Added the codebase for a Rename Preview option into the mix - GUI available, but not linked, FIX: Removed DEM from RSS scans when Public Torrents option is enabled, FIX:(#2137) When adding series, if series indicated date in a different format other than just numeric, would cause error
2018-12-10 17:27:53 +00:00
helpers . disable_provider ( ' 32P ' )
FIX: included version of comictagger should now work with both Windows and *nix based OS' again, IMP: Global Copy/Move option available when performing post-processing, IMP: Added a verbose file-checking option (FOLDER_SCAN_LOG_VERBOSE) - when enabled will log as it currently does during manual post-processing/file-checking runs, when disabled it will not spam the log nearly as much resulting in more readable log files, IMP: Added Verbose debug logging both via startup option(-v), as well as toggle button in Log GUI (from headphones), as well as per-page loading of log file(s) in GUI, FIX: When doing manual post-processing on issues that were in story arcs, will now indicate X story-arc issues were post-processed for better visibility, FIX: Fixed an issue with deleting from the nzblog table when story arc issues were post-processed, IMP: Added WEEKFOLDER_LOC to the config.ini to allow for specification of where the weekly download directories will default to (as opposed to off of ComicLocation root), IMP: Better handling of some special character references in series titles when looking for series on the auto-wanted list, IMP: 32P will now auto-disable provider if logon returns invalid credentials, FIX: When using alt_pull on weekly pull list, xA0 unicode character caused error, FIX: If title had invalid character in filename that was replaced with a character that already existed in the title, would not scan in during file-checking, FIX: When searching for a series (weeklypull-list/add a series), if the title contained 'and' or '&' would return really mixed up results, FIX: When Post-Processing, if filename being processed had special characters (ie. comma) and was different than nzbname, in some cases would fail to find/move issues, IMP: Utilize internal comictagger to convert from cbr/cbz, IMP: Added more checks when post-processing to ensure files are handled correctly, IMP: Added meta-tag reading when importing series/issues - if previously tagged with CT, will reverse look-up the provided IssueID to reference the correct ComicID, IMP: If scanned directory during import contins cvinfo file, use that and force the ComicID to entire directory when importing a series, IMP: Manual meta-tagging issues will no longer create temporary directories and/or create files in the Comic Location root causing problems for some users, FIX: Annuals weren't properly sorted upon loading of comic details page for some series, IMP: Added some extra checks when validating/creating directories, FIX: Fixed a problem when displaying some covers of .cbz files on the comic details page
2016-01-26 07:49:56 +00:00
return " fail "
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . PASSKEY_32P is None or mylar . AUTHKEY_32P is None or mylar . KEYS_32P is None :
2015-05-14 09:33:40 +00:00
logger . error ( ' [RSS] Unable to sign-on to 32P to validate settings and initiate download sequence. Please enter/check your username password in the configuration. ' )
return " fail "
IMP: 32P legacy mode (rss feed only) and Auth mode (user/pass) available now. With Auth mode, will monitor all of personal notification feeds, IMP: Changed access methods to 32P for retrieving links, FIX:(#1007) Fixed error for one-off downloading via weekly pull list, FIX: (#1004) Fix for post-processing errors (missing files), FIX: (#1001) Extra scripts & pre-scripts will now accept bash scripts, FIX: Annuals were being incorrectly tallied in Have total as well as not having status correctly updated, IMP: Fixed some discrepencies with the provider_order generation line, IMP: Made some additional adjustments to the file-checking to account for some additional variations in naming, FIX: Fixed traceback errors when folder monitor was running and wouldn't be able to complete the post-processing properly, FIX: Cleanup code and some other small fixes....
2015-05-09 02:39:28 +00:00
else :
2015-05-14 09:33:40 +00:00
logger . fdebug ( ' [32P-AUTHENTICATION] 32P (Auth Mode) Authentication already done. Attempting to use existing keys. ' )
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
payload = { ' action ' : ' download ' ,
2017-10-25 18:33:56 +00:00
' torrent_pass ' : mylar . CONFIG . PASSKEY_32P ,
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
' authkey ' : mylar . AUTHKEY_32P ,
' id ' : linkit }
2019-02-05 18:12:33 +00:00
dfile = auth32p . info32p ( )
file_download = dfile . downloadfile ( payload , filepath )
if file_download is False :
return " fail "
2017-06-09 00:23:59 +00:00
2019-02-05 18:12:33 +00:00
logger . fdebug ( ' [ %s ] Saved torrent file to : %s ' % ( site , filepath ) )
2016-08-20 21:56:30 +00:00
elif site == ' DEM ' :
url = helpers . torrent_create ( ' DEM ' , linkit )
if url . startswith ( ' https ' ) :
2017-09-06 01:27:54 +00:00
dem_referrer = mylar . DEMURL + ' files/download/ '
2016-08-20 21:56:30 +00:00
else :
2017-09-06 01:27:54 +00:00
dem_referrer = ' http ' + mylar . DEMURL [ 5 : ] + ' files/download/ '
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
2015-05-22 08:32:51 +00:00
headers = { ' Accept-encoding ' : ' gzip ' ,
IMP: (#1122) Added provider OMGWTFNZBS (results untested), FIX:(#1124) Experimental search results had a 1/9 (or simliar) parts as part of the header, would error out trying to create the nzb due to invalid path, FIX: When importing a series, if Move Files wasn't enabled would error out during the import process, FIX: When on Import page, if selecting Save Changes without Scanning Library would leave pop-up notification up forever, FIX: When searching for series (like A-Force), results would return 16000+ which would look like it locked up due to the excessive number of results - will now better handle such titles, and overall search results are limited to the first 1000 hits, FIX: When clicking on 'Add Series' from the pull-list, if a series was a new series with no issues published would return 0 results from CV even though the series would exist, FIX:(#1120) Story Arcs with special characters would cause error during manual post-processing run, FIX:(#1125) If year is fuzzied for a given series when searching, would error out with invalid date comparisons
2015-09-11 15:49:56 +00:00
' User-Agent ' : str ( mylar . USER_AGENT ) ,
2016-08-20 21:56:30 +00:00
' Referer ' : dem_referrer }
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
IMP: (#1122) Added provider OMGWTFNZBS (results untested), FIX:(#1124) Experimental search results had a 1/9 (or simliar) parts as part of the header, would error out trying to create the nzb due to invalid path, FIX: When importing a series, if Move Files wasn't enabled would error out during the import process, FIX: When on Import page, if selecting Save Changes without Scanning Library would leave pop-up notification up forever, FIX: When searching for series (like A-Force), results would return 16000+ which would look like it locked up due to the excessive number of results - will now better handle such titles, and overall search results are limited to the first 1000 hits, FIX: When clicking on 'Add Series' from the pull-list, if a series was a new series with no issues published would return 0 results from CV even though the series would exist, FIX:(#1120) Story Arcs with special characters would cause error during manual post-processing run, FIX:(#1125) If year is fuzzied for a given series when searching, would error out with invalid date comparisons
2015-09-11 15:49:56 +00:00
logger . fdebug ( ' Grabbing torrent from url: ' + str ( url ) )
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
payload = None
verify = False
2016-08-20 21:56:30 +00:00
elif site == ' WWT ' :
url = helpers . torrent_create ( ' WWT ' , linkit )
if url . startswith ( ' https ' ) :
2017-09-06 01:27:54 +00:00
wwt_referrer = mylar . WWTURL
2016-08-20 21:56:30 +00:00
else :
2017-09-06 01:27:54 +00:00
wwt_referrer = ' http ' + mylar . WWTURL [ 5 : ]
2016-08-20 21:56:30 +00:00
headers = { ' Accept-encoding ' : ' gzip ' ,
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
' User-Agent ' : mylar . CV_HEADERS [ ' User-Agent ' ] ,
2016-08-20 21:56:30 +00:00
' Referer ' : wwt_referrer }
logger . fdebug ( ' Grabbing torrent [id: ' + str ( linkit ) + ' ] from url: ' + str ( url ) )
payload = { ' id ' : linkit }
verify = False
2015-08-11 21:56:22 +00:00
else :
headers = { ' Accept-encoding ' : ' gzip ' ,
' User-Agent ' : str ( mylar . USER_AGENT ) }
2016-08-20 21:56:30 +00:00
url = linkit
2015-08-11 21:56:22 +00:00
payload = None
verify = False
2019-02-05 18:12:33 +00:00
if site != ' Public Torrents ' and site != ' 32P ' :
2017-06-09 00:23:59 +00:00
if not verify :
#32P throws back an insecure warning because it can't validate against the CA. The below suppresses the message just for 32P instead of being displayed.
#disable SSL warnings - too many 'warning' messages about invalid certificates
2015-04-19 23:39:02 +00:00
try :
2017-06-09 00:23:59 +00:00
from requests . packages . urllib3 import disable_warnings
disable_warnings ( )
2015-04-19 23:39:02 +00:00
except ImportError :
2017-06-09 00:23:59 +00:00
#this is probably not necessary and redudant, but leaving in for the time being.
from requests . packages . urllib3 . exceptions import InsecureRequestWarning
requests . packages . urllib3 . disable_warnings ( )
try :
from urllib3 . exceptions import InsecureRequestWarning
urllib3 . disable_warnings ( )
except ImportError :
logger . warn ( ' [EPIC FAILURE] Cannot load the requests module ' )
FIX: included version of comictagger should now work with both Windows and *nix based OS' again, IMP: Global Copy/Move option available when performing post-processing, IMP: Added a verbose file-checking option (FOLDER_SCAN_LOG_VERBOSE) - when enabled will log as it currently does during manual post-processing/file-checking runs, when disabled it will not spam the log nearly as much resulting in more readable log files, IMP: Added Verbose debug logging both via startup option(-v), as well as toggle button in Log GUI (from headphones), as well as per-page loading of log file(s) in GUI, FIX: When doing manual post-processing on issues that were in story arcs, will now indicate X story-arc issues were post-processed for better visibility, FIX: Fixed an issue with deleting from the nzblog table when story arc issues were post-processed, IMP: Added WEEKFOLDER_LOC to the config.ini to allow for specification of where the weekly download directories will default to (as opposed to off of ComicLocation root), IMP: Better handling of some special character references in series titles when looking for series on the auto-wanted list, IMP: 32P will now auto-disable provider if logon returns invalid credentials, FIX: When using alt_pull on weekly pull list, xA0 unicode character caused error, FIX: If title had invalid character in filename that was replaced with a character that already existed in the title, would not scan in during file-checking, FIX: When searching for a series (weeklypull-list/add a series), if the title contained 'and' or '&' would return really mixed up results, FIX: When Post-Processing, if filename being processed had special characters (ie. comma) and was different than nzbname, in some cases would fail to find/move issues, IMP: Utilize internal comictagger to convert from cbr/cbz, IMP: Added more checks when post-processing to ensure files are handled correctly, IMP: Added meta-tag reading when importing series/issues - if previously tagged with CT, will reverse look-up the provided IssueID to reference the correct ComicID, IMP: If scanned directory during import contins cvinfo file, use that and force the ComicID to entire directory when importing a series, IMP: Manual meta-tagging issues will no longer create temporary directories and/or create files in the Comic Location root causing problems for some users, FIX: Annuals weren't properly sorted upon loading of comic details page for some series, IMP: Added some extra checks when validating/creating directories, FIX: Fixed a problem when displaying some covers of .cbz files on the comic details page
2016-01-26 07:49:56 +00:00
return " fail "
2019-02-05 18:12:33 +00:00
2017-06-09 00:23:59 +00:00
try :
scraper = cfscrape . create_scraper ( )
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
if site == ' WWT ' :
if mylar . WWT_CF_COOKIEVALUE is None :
2019-04-27 21:15:50 +00:00
cf_cookievalue , cf_user_agent = scraper . get_tokens ( url , user_agent = mylar . CV_HEADERS [ ' User-Agent ' ] )
IMP: Tiered wanted list searching - anything older than 2 weeks will only by searched for using RSS and/or manual means (scheduled searches only), IMP: Tiered option viewable in Upcoming tab, FIX: Fixed API searching against WWT option (RSS is still broken however, as that is due to WWT), IMP: Removed cherrypy logging in some instances, IMP: Updated cfscrape library to most recent, FIX: Fixed problem with simliar titles being incorrectly post-processed due to multiple matches when manual post-processing, FIX: Fixed notifications not firing off on a successful manual post-process/folder monitor due to some previous changes, FIX: If grabbag_dir was not set, would not correctly set the location, FIX:(#2051) When using nzbget, if nzbToMylar is enabled along with CDH - warning will be issued within Mylar to indicate as such
2018-08-31 16:03:54 +00:00
mylar . WWT_CF_COOKIEVALUE = cf_cookievalue
r = scraper . get ( url , params = payload , cookies = mylar . WWT_CF_COOKIEVALUE , verify = verify , stream = True , headers = headers )
2017-06-09 00:23:59 +00:00
else :
r = scraper . get ( url , params = payload , verify = verify , stream = True , headers = headers )
#r = requests.get(url, params=payload, verify=verify, stream=True, headers=headers)
except Exception , e :
logger . warn ( ' Error fetching data from %s ( %s ): %s ' % ( site , url , e ) )
2019-02-05 18:12:33 +00:00
# if site == '32P':
# logger.info('[TOR2CLIENT-32P] Retrying with 32P')
# if mylar.CONFIG.MODE_32P == 1:
# logger.info('[TOR2CLIENT-32P] Attempting to re-authenticate against 32P and poll new keys as required.')
# feed32p = auth32p.info32p(reauthenticate=True)
# feedinfo = feed32p.authenticate()
# if feedinfo == "disable":
# helpers.disable_provider('32P')
# return "fail"
# logger.debug('[TOR2CLIENT-32P] Creating CF Scraper')
# scraper = cfscrape.create_scraper()
# try:
# r = scraper.get(url, params=payload, verify=verify, allow_redirects=True)
# except Exception, e:
# logger.warn('[TOR2CLIENT-32P] Unable to GET %s (%s): %s' % (site, url, e))
# return "fail"
# else:
# logger.warn('[TOR2CLIENT-32P] Unable to authenticate using existing RSS Feed given. Make sure that you have provided a CURRENT feed from 32P')
# return "fail"
# else:
# return "fail"
2013-07-30 04:57:37 +00:00
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
if any ( [ site == ' DEM ' , site == ' WWT ' ] ) and any ( [ str ( r . status_code ) == ' 403 ' , str ( r . status_code ) == ' 404 ' , str ( r . status_code ) == ' 503 ' ] ) :
2017-06-09 00:23:59 +00:00
if str ( r . status_code ) != ' 503 ' :
logger . warn ( ' Unable to download from ' + site + ' [ ' + str ( r . status_code ) + ' ] ' )
#retry with the alternate torrent link.
url = helpers . torrent_create ( site , linkit , True )
logger . fdebug ( ' Trying alternate url: ' + str ( url ) )
try :
r = requests . get ( url , params = payload , verify = verify , stream = True , headers = headers )
2015-07-22 21:00:45 +00:00
2017-06-09 00:23:59 +00:00
except Exception , e :
return " fail "
else :
logger . warn ( ' Cloudflare protection online for ' + site + ' . Attempting to bypass... ' )
try :
scraper = cfscrape . create_scraper ( )
cf_cookievalue , cf_user_agent = cfscrape . get_cookie_string ( url )
headers = { ' Accept-encoding ' : ' gzip ' ,
' User-Agent ' : cf_user_agent }
2017-09-06 01:27:54 +00:00
2017-06-09 00:23:59 +00:00
r = scraper . get ( url , verify = verify , cookies = cf_cookievalue , stream = True , headers = headers )
except Exception , e :
return " fail "
2015-07-22 21:00:45 +00:00
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
if any ( [ site == ' DEM ' , site == ' WWT ' ] ) :
2017-06-09 00:23:59 +00:00
if r . headers . get ( ' Content-Encoding ' ) == ' gzip ' :
buf = StringIO ( r . content )
f = gzip . GzipFile ( fileobj = buf )
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
2017-06-09 00:23:59 +00:00
with open ( filepath , ' wb ' ) as f :
for chunk in r . iter_content ( chunk_size = 1024 ) :
if chunk : # filter out keep-alive new chunks
f . write ( chunk )
f . flush ( )
logger . fdebug ( ' [ ' + site + ' ] Saved torrent file to : ' + filepath )
else :
2019-02-05 18:12:33 +00:00
if site != ' 32P ' :
#tpse is magnet links only...
filepath = linkit
IMP: 32P support added (identical to CBT, no backlog searching but full RSS url is required for usage), IMP: Threaded RSS Check (will only run once concurrently), IMP: Added option to enable/disable Snatched/Failed to show on Wanted tab, FIX: Removed UID from dognzb config, IMP: Removed apikey from being stored in db for dognzb, IMP: Will only store ID/HASH for torrents, instead of entire link - will recreate dynamically as required, IMP: Switched to requests for torrent retrieval, IMP: Removed getdefaultlocal requirements on startup (would fail startup on some OSX systems), IMP: Will now display covers that are in 00.png format when viewing issue details, IMP: Fixed incorrect logic for dupecheck status checks, FIX: Removed some unneeded print statements
2015-04-15 04:10:52 +00:00
2016-05-05 15:11:39 +00:00
if mylar . USE_UTORRENT :
2016-10-05 14:12:58 +00:00
uTC = utorrent . utorrentclient ( )
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
#if site == 'TPSE':
# ti = uTC.addurl(linkit)
#else:
ti = uTC . addfile ( filepath , filename )
FIX:(#1630) One-off issues will now be post-processed according to grab-bag dir location, IMP: One-off pull-list issues will now have the status marked accordingly on weekly pullist for tracking purposes, FIX: Fix for utorrent not being able to update status properly after initial snatch, FIX: Fix for some incorrect variable references due to different snatch methods when trying to run on-snatch scripts, FIX: Fix for auto-torrent-snatcher trying to snatch a torrent with an '&' in the filename, FIX:(#1637) Fix for telegram not saving on snatch toggle properly, IMP: added additional logging for metatagging when attempting to create temp folder in cache location, IMP: will now clean up any left over metagtagging directories that fail during normal post-processing instead of leaving and continuing, FIX: Will notify on one-off grab's/storyarc's being post-processed, FIX: fix for displaying cbz issue details (the 'i' on the comic details page) in which the series title contained non-alphanumeric characters, IMP: Added ability to change status to Wanted on Upcoming tab (will perform an immediate search on selected issues), IMP: Threaded the one-off search call from the weeklypull
2017-06-02 14:05:06 +00:00
if ti == ' fail ' :
return ti
else :
#if ti is value, it will return the hash
2018-03-02 07:08:49 +00:00
torrent_info = { }
FIX:(#1630) One-off issues will now be post-processed according to grab-bag dir location, IMP: One-off pull-list issues will now have the status marked accordingly on weekly pullist for tracking purposes, FIX: Fix for utorrent not being able to update status properly after initial snatch, FIX: Fix for some incorrect variable references due to different snatch methods when trying to run on-snatch scripts, FIX: Fix for auto-torrent-snatcher trying to snatch a torrent with an '&' in the filename, FIX:(#1637) Fix for telegram not saving on snatch toggle properly, IMP: added additional logging for metatagging when attempting to create temp folder in cache location, IMP: will now clean up any left over metagtagging directories that fail during normal post-processing instead of leaving and continuing, FIX: Will notify on one-off grab's/storyarc's being post-processed, FIX: fix for displaying cbz issue details (the 'i' on the comic details page) in which the series title contained non-alphanumeric characters, IMP: Added ability to change status to Wanted on Upcoming tab (will perform an immediate search on selected issues), IMP: Threaded the one-off search call from the weeklypull
2017-06-02 14:05:06 +00:00
torrent_info [ ' hash ' ] = ti
2017-04-28 06:12:45 +00:00
torrent_info [ ' clientmode ' ] = ' utorrent '
torrent_info [ ' link ' ] = linkit
return torrent_info
2016-10-05 14:12:58 +00:00
2016-05-11 13:59:32 +00:00
elif mylar . USE_RTORRENT :
import test
rp = test . RTorrent ( )
2017-04-28 06:12:45 +00:00
2017-09-06 01:27:54 +00:00
torrent_info = rp . main ( filepath = filepath )
2016-05-11 13:59:32 +00:00
if torrent_info :
2017-04-28 06:12:45 +00:00
torrent_info [ ' clientmode ' ] = ' rtorrent '
torrent_info [ ' link ' ] = linkit
return torrent_info
2016-05-11 13:59:32 +00:00
else :
2017-04-28 06:12:45 +00:00
return ' fail '
2016-06-24 09:27:41 +00:00
elif mylar . USE_TRANSMISSION :
try :
rpc = transmission . TorrentClient ( )
2017-10-25 18:33:56 +00:00
if not rpc . connect ( mylar . CONFIG . TRANSMISSION_HOST , mylar . CONFIG . TRANSMISSION_USERNAME , mylar . CONFIG . TRANSMISSION_PASSWORD ) :
2016-06-24 09:27:41 +00:00
return " fail "
2017-04-28 06:12:45 +00:00
torrent_info = rpc . load_torrent ( filepath )
if torrent_info :
torrent_info [ ' clientmode ' ] = ' transmission '
torrent_info [ ' link ' ] = linkit
return torrent_info
2016-06-24 09:27:41 +00:00
else :
return " fail "
except Exception as e :
logger . error ( e )
return " fail "
2016-12-17 14:24:12 +00:00
elif mylar . USE_DELUGE :
try :
dc = deluge . TorrentClient ( )
2017-10-25 18:33:56 +00:00
if not dc . connect ( mylar . CONFIG . DELUGE_HOST , mylar . CONFIG . DELUGE_USERNAME , mylar . CONFIG . DELUGE_PASSWORD ) :
2017-04-28 06:12:45 +00:00
logger . info ( ' Not connected to Deluge! ' )
IMP:New scheduler tab (Manage / Activity) where you can see job current run status', next runtime, and prev runtimes as well as force/pause a job, FIX: Disabling
torrents will now properly hide torrent information, IMP: Specified daemon port for deluge as an on-screen tip for more detail, IMP: Added 100,200,ALL as viewable
watchlist views, FIX: When viewing pullist and annual integration enabled, if annual was present would incorrectly link to invalid annual series instead of the
actual series itself, IMP: Added more detail error messages to metatagging errors and better handling of stranded files during cleanup, IMP: Improved some handling for weekly pull-list one-off's and refactored the
nzb/oneoff post-processing into a seperate function for future callables, Moved all the main url locations for public torrent sites to the init module so that it
can be cascaded down for use in other modules instead as a global, IMP: Added a 'deep_search_32p' variable in the config.ini for specific usage with 32p, where
if there is more than one result will dig deeper into each result to try and figure out if there are series matches, as opposed to the default where it will only use ref32p
table if available or just the first hit in a multiple series search results and ignore the remainder, FIX:Fixed some unknown characters appearing in the pullist due
to unicode-related conversion problems, FIX: fixed some special cases of file parsing errors due to Volume label being named different than expected, FIX: Added a
3s pause between experimental searches to try and not hit their frequency limitation, IMP: Weekly Pullist One-off's will now show status of Snatched/Downloaded as
required, FIX: Fixed some deluge parameter problems when using auto-snatch torrent script/option, IMP: Changed the downlocation in the auto-snatch option to an
env variable instead of being passed to avoid unicode-related problems, FIX: Fixed some magnet-related issues for torrents when using a watchdir + TPSE, FIX: Added
more verbose error message for rtorrent connection issues, FIX: Could not connect to rtorrent client if no username/password were provided, IMP: Set the db updater to run
every 5 minutes on the watchlist, automatically refreshing the oldest updated series each time that is more than 5 hours old (force db update from the activity/job schedulers page will run the db updater
against the entire watchlist in sequence), IMP: Attempt to handle long paths in windows (ie. > 256c) by prepending the unicode windows api character to the import
a directory path (windows only), IMP: When manual metatagging a series, will update the series after all the metatagging has been completed as opposed to after each
issue, IMP: Will now display available inkdrops on Config/Search Providers tab when using 32P (future will utilize/indicate inkdrop threshold when downloading)
2017-09-10 15:50:08 +00:00
return " fail "
2016-12-17 14:24:12 +00:00
else :
2017-04-28 06:12:45 +00:00
logger . info ( ' Connected to Deluge! Will try to add torrent now! ' )
torrent_info = dc . load_torrent ( filepath )
if torrent_info :
torrent_info [ ' clientmode ' ] = ' deluge '
torrent_info [ ' link ' ] = linkit
return torrent_info
2016-12-17 14:24:12 +00:00
else :
return " fail "
2017-04-28 06:12:45 +00:00
logger . info ( ' Unable to connect to Deluge! ' )
2016-12-17 14:24:12 +00:00
except Exception as e :
logger . error ( e )
return " fail "
2017-09-06 01:27:54 +00:00
2017-04-28 06:12:45 +00:00
elif mylar . USE_QBITTORRENT :
try :
qc = qbittorrent . TorrentClient ( )
2017-10-25 18:33:56 +00:00
if not qc . connect ( mylar . CONFIG . QBITTORRENT_HOST , mylar . CONFIG . QBITTORRENT_USERNAME , mylar . CONFIG . QBITTORRENT_PASSWORD ) :
2017-04-28 06:12:45 +00:00
logger . info ( ' Not connected to qBittorrent - Make sure the Web UI is enabled and the port is correct! ' )
return " fail "
else :
logger . info ( ' Connected to qBittorrent! Will try to add torrent now! ' )
torrent_info = qc . load_torrent ( filepath )
2017-05-07 17:44:18 +00:00
if torrent_info [ ' status ' ] is True :
2017-04-28 06:12:45 +00:00
torrent_info [ ' clientmode ' ] = ' qbittorrent '
torrent_info [ ' link ' ] = linkit
return torrent_info
else :
logger . info ( ' Unable to add torrent to qBittorrent ' )
return " fail "
except Exception as e :
logger . error ( e )
return " fail "
2017-09-06 01:27:54 +00:00
FIX:(#1431) Fixed post-processing cleanup when using SAB + files resided in a sub-folder of the path sent from SAB, IMP: Added hardlink/softlink option for non-windows users (note that metatagging is forcibly disabled when these options are enabled), IMP: Added Enforce Permissions option to force Mylar to either force / ensure permissions are as set within Mylar, or to ignore permissions and just try to perform the given action (this is for adding series, post-processing, importing, arcs, etc), FIX: Fixed a problem where if local watchdir was set and a torrent downloader was selected, both would attempt to be used, but only the watchdir was actually utilized (now it's one or the other, never both), FIX: Mylar will now remove issues that are in Failed status that have incorrect Series Data attached, FIX:(#1438) When file-checking/post-processing if issue date in Mylar was current year and date in filename was the following year (for end-of-year issues), would cause traceback error, FIX: If series year polled from CV is incorrect or not provided, option is available in Edit Settings of series detail page that allows user to specify the correct series year, FIX:(#1427) Fixed a typo when the Scan Library option is used and ComicID's were able to be parsed from the files, FIX: When issues were archived, depending on if series had issues in a Downloaded status or not, would give different results to the Have totals, IMP: Manage tab / Manage Comics now has metatag option available to allow metatagging multiple series in a batch mode, IMP:(#1419) When 'write cvinfo' option is enabled, will now also write cvinfo into story arc directories when added / refreshed, FIX: Fixed a problem when group metatag was being used and causing errors, IMP: Manage Failed page now will link back to the series for easier reference, and the 'link' column was removed due to invalid references, FIX: Removed the 'issue not updated' from the series detail page as was not accurate, IMP: Added a Select Filtered Issues button to the series detail page to allow for selecting of all filtered issues (Show ALL MUST be enabled for it to work properly)
2016-11-02 15:00:56 +00:00
elif mylar . USE_WATCHDIR :
2017-10-25 18:33:56 +00:00
if mylar . CONFIG . TORRENT_LOCAL :
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
#if site == 'TPSE':
# torrent_info = {'hash': pubhash}
#else:
# #get the hash so it doesn't mess up...
torrent_info = helpers . get_the_hash ( filepath )
2017-05-01 18:42:14 +00:00
torrent_info [ ' clientmode ' ] = ' watchdir '
torrent_info [ ' link ' ] = linkit
torrent_info [ ' filepath ' ] = filepath
return torrent_info
FIX:(#1431) Fixed post-processing cleanup when using SAB + files resided in a sub-folder of the path sent from SAB, IMP: Added hardlink/softlink option for non-windows users (note that metatagging is forcibly disabled when these options are enabled), IMP: Added Enforce Permissions option to force Mylar to either force / ensure permissions are as set within Mylar, or to ignore permissions and just try to perform the given action (this is for adding series, post-processing, importing, arcs, etc), FIX: Fixed a problem where if local watchdir was set and a torrent downloader was selected, both would attempt to be used, but only the watchdir was actually utilized (now it's one or the other, never both), FIX: Mylar will now remove issues that are in Failed status that have incorrect Series Data attached, FIX:(#1438) When file-checking/post-processing if issue date in Mylar was current year and date in filename was the following year (for end-of-year issues), would cause traceback error, FIX: If series year polled from CV is incorrect or not provided, option is available in Edit Settings of series detail page that allows user to specify the correct series year, FIX:(#1427) Fixed a typo when the Scan Library option is used and ComicID's were able to be parsed from the files, FIX: When issues were archived, depending on if series had issues in a Downloaded status or not, would give different results to the Have totals, IMP: Manage tab / Manage Comics now has metatag option available to allow metatagging multiple series in a batch mode, IMP:(#1419) When 'write cvinfo' option is enabled, will now also write cvinfo into story arc directories when added / refreshed, FIX: Fixed a problem when group metatag was being used and causing errors, IMP: Manage Failed page now will link back to the series for easier reference, and the 'link' column was removed due to invalid references, FIX: Removed the 'issue not updated' from the series detail page as was not accurate, IMP: Added a Select Filtered Issues button to the series detail page to allow for selecting of all filtered issues (Show ALL MUST be enabled for it to work properly)
2016-11-02 15:00:56 +00:00
else :
tssh = ftpsshup . putfile ( filepath , filename )
return tssh
IMP: Added Choose specific Download option to manually select from result list on Upcoming/Details/Weekly tabs, IMP: Added Wanted storyarcs to the overall Wanted section so now will search as per global options (storyarc issues can be displayed optionally on Wanted tab), IMP: Added custom url option for image banners/posters for storyarcs, IMP: updated Cherrypy, FIX: Fixed ComicRN not working when forms authentication used - in conjunction updated autoProcessComics to 2.0 which now uses apikey instead of user/pass, IMP: Alternate Series Covers option for alternating existing series image to the most current issue image, IMP: Added overall series total to series page for reference, IMP: Search workflow completely changed to accomodate more than one indexer - now will simultaneously sumbit initial request to each provider, wait 30s submit additional as required at 30s intervals, FIX: Removed TPSE as an option and relabelled to just Public Torrents, IMP: Added direct backlog search to WWT option (pack support will follow), FIX: Removed line about configparser being required for ComicTagger usage, IMP: Test code in place for newzab testing, FIX: Fixed layout problem with torrents that are in auto-snatch status on weekly tab, IMP: backend code improvements to allow for better alias usage and annual linking directly from WS, IMP: Updated systemd init-scripts with read.me, IMP: When post-processing, will now check for available destination free space before actually moving files, IMP: Will copy during metatagging to cache folder instead of move being an option so cleanup is cleaner if something fails, FIX: Changed readinglist table to storyarcs for clarity, IMP: When post-processing issues, will now only update the one issue status and adjust totals accordingly (instead of doing a complete rescan of the series), FIX: Clear out empty ID's from the Failed DB on startup, IMP: Initial code-run at REST API interface, FIX: Fixed some matching problems with 32p due to case, IMP: removed apikeys from log entries that were accidentally logging, IMP: When searching 32p, if items get packed up - will now delete the cached reference so new items of the same can be located, IMP: ForceSearch option switched to scheduler so simultaneous runs should not occur, FIX: Fixed manual metatagging error that would occur if multiple destination directories existed
2018-02-16 19:57:01 +00:00
def delete_cache_entry ( id ) :
myDB = db . DBConnection ( )
myDB . action ( " DELETE FROM rssdb WHERE link=? AND Site= ' 32P ' " , [ id ] )
FIX:(#1431) Fixed post-processing cleanup when using SAB + files resided in a sub-folder of the path sent from SAB, IMP: Added hardlink/softlink option for non-windows users (note that metatagging is forcibly disabled when these options are enabled), IMP: Added Enforce Permissions option to force Mylar to either force / ensure permissions are as set within Mylar, or to ignore permissions and just try to perform the given action (this is for adding series, post-processing, importing, arcs, etc), FIX: Fixed a problem where if local watchdir was set and a torrent downloader was selected, both would attempt to be used, but only the watchdir was actually utilized (now it's one or the other, never both), FIX: Mylar will now remove issues that are in Failed status that have incorrect Series Data attached, FIX:(#1438) When file-checking/post-processing if issue date in Mylar was current year and date in filename was the following year (for end-of-year issues), would cause traceback error, FIX: If series year polled from CV is incorrect or not provided, option is available in Edit Settings of series detail page that allows user to specify the correct series year, FIX:(#1427) Fixed a typo when the Scan Library option is used and ComicID's were able to be parsed from the files, FIX: When issues were archived, depending on if series had issues in a Downloaded status or not, would give different results to the Have totals, IMP: Manage tab / Manage Comics now has metatag option available to allow metatagging multiple series in a batch mode, IMP:(#1419) When 'write cvinfo' option is enabled, will now also write cvinfo into story arc directories when added / refreshed, FIX: Fixed a problem when group metatag was being used and causing errors, IMP: Manage Failed page now will link back to the series for easier reference, and the 'link' column was removed due to invalid references, FIX: Removed the 'issue not updated' from the series detail page as was not accurate, IMP: Added a Select Filtered Issues button to the series detail page to allow for selecting of all filtered issues (Show ALL MUST be enabled for it to work properly)
2016-11-02 15:00:56 +00:00
2013-07-30 04:57:37 +00:00
if __name__ == ' __main__ ' :
#torrents(sys.argv[1])
#torrentdbsearch(sys.argv[1], sys.argv[2], sys.argv[3])
2015-03-20 08:06:56 +00:00
nzbs ( provider = sys . argv [ 1 ] )