2013-07-30 04:57:37 +00:00
#!/usr/bin/python
import os , sys
import re
import lib . feedparser as feedparser
2015-04-17 18:35:05 +00:00
import lib . requests as requests
2013-07-30 04:57:37 +00:00
import ftpsshup
import datetime
2013-09-05 02:36:41 +00:00
import gzip
from StringIO import StringIO
2013-07-30 04:57:37 +00:00
import mylar
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
from mylar import db , logger , ftpsshup , helpers , auth32p
2013-07-30 04:57:37 +00:00
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 )
if mylar . KAT_PROXY :
if mylar . KAT_PROXY . endswith ( ' / ' ) :
kat_url = mylar . KAT_PROXY
else :
kat_url = mylar . KAT_PROXY + ' / '
else :
2015-04-19 23:39:02 +00:00
#switched to https.
kat_url = ' https://kat.ph/ '
2013-10-19 01:04:16 +00:00
2014-04-14 17:59:27 +00:00
if pickfeed == ' KAT ' :
#we need to cycle through both categories (comics & other) - so we loop.
loopit = 2
2013-07-30 04:57:37 +00:00
else :
2014-04-14 17:59:27 +00:00
loopit = 1
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 ( )
2013-08-07 06:27:12 +00:00
torthekat = [ ]
katinfo = { }
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 :
2014-04-14 17:59:27 +00:00
pickfeed = ' 2 '
2015-05-22 08:32:51 +00:00
elif lp == 1 and loopit == 2 :
pickfeed = ' 5 '
2014-04-14 17:59:27 +00:00
feedtype = None
2015-05-22 08:32:51 +00:00
if pickfeed == " 1 " and mylar . ENABLE_32P : # 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 '
elif pickfeed == " 2 " and srchterm is not None : # kat.ph search
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
feed = kat_url + " usearch/ " + str ( srchterm ) + " %20c ategory % 3Acomics %20s eeds % 3A " + str ( mylar . MINSEEDS ) + " /?rss=1 "
2014-04-14 17:59:27 +00:00
elif pickfeed == " 3 " : # kat.ph rss feed
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
feed = kat_url + " usearch/category % 3Acomics %20s eeds % 3A " + str ( mylar . MINSEEDS ) + " /?rss=1 "
2014-04-14 17:59:27 +00:00
feedtype = ' from the New Releases RSS Feed for comics '
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
2015-05-22 08:32:51 +00:00
if any ( [ mylar . USERNAME_32P is None , mylar . USERNAME_32P == ' ' , mylar . PASSWORD_32P is None , mylar . 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
if mylar . MODE_32P == 0 :
logger . warn ( ' [32P] Searching is not available in 32p Legacy mode. Switch to Auth mode to use the search functionality. ' )
lp = + 1
continue
2015-05-14 09:33:40 +00:00
#searchit = auth32p.info32p(searchterm=seriesname)
#searchresults = searchit.authenticate()
#logger.info('search results: ' + str(searchresults))
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
return
2015-05-22 08:32:51 +00:00
elif pickfeed == " 5 " and srchterm is not None : # kat.ph search (category:other since some 0-day comics initially get thrown there until categorized)
2014-04-14 17:59:27 +00:00
feed = kat_url + " usearch/ " + str ( srchterm ) + " %20c ategory % 3Aother %20s eeds % 3A1/?rss=1 "
elif pickfeed == " 6 " : # kat.ph rss feed (category:other so that we can get them quicker if need-be)
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
feed = kat_url + " usearch/.cbr %20c ategory % 3Aother %20s eeds % 3A " + str ( mylar . MINSEEDS ) + " /?rss=1 "
2015-05-22 08:32:51 +00:00
feedtype = ' from the New Releases for category Other RSS Feed that contain comics '
elif int ( pickfeed ) > = 7 and feedinfo is not None :
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 ' ]
2015-05-22 08:32:51 +00:00
2014-04-14 17:59:27 +00:00
else :
logger . error ( ' invalid pickfeed denoted... ' )
return
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.info('feed URL: ' + str(feed))
2015-05-22 08:32:51 +00:00
2014-04-14 17:59:27 +00:00
feedme = feedparser . parse ( feed )
2013-07-30 04:57:37 +00:00
2014-04-14 17:59:27 +00:00
if pickfeed == " 3 " or pickfeed == " 6 " or pickfeed == " 2 " or pickfeed == " 5 " :
picksite = ' KAT '
2015-05-22 08:32:51 +00:00
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
i = 0
2015-05-14 09:33:40 +00:00
2014-04-14 17:59:27 +00:00
for entry in feedme [ ' entries ' ] :
if pickfeed == " 3 " or pickfeed == " 6 " :
tmpsz = feedme . entries [ i ] . enclosures [ 0 ]
feeddata . append ( {
2015-05-22 08:32:51 +00:00
' site ' : picksite ,
' title ' : feedme . entries [ i ] . title ,
' link ' : tmpsz [ ' url ' ] ,
' pubdate ' : feedme . entries [ i ] . updated ,
' size ' : tmpsz [ ' length ' ]
} )
2014-04-14 17:59:27 +00:00
elif pickfeed == " 2 " or pickfeed == " 5 " :
tmpsz = feedme . entries [ i ] . enclosures [ 0 ]
torthekat . append ( {
' site ' : picksite ,
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
' title ' : feedme . entries [ i ] . title ,
2014-04-14 17:59:27 +00:00
' link ' : tmpsz [ ' url ' ] ,
' pubdate ' : feedme . entries [ i ] . updated ,
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
' size ' : tmpsz [ ' length ' ]
2014-04-14 17:59:27 +00:00
} )
2015-05-22 08:32:51 +00:00
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 == " 1 " or pickfeed == " 4 " or int ( pickfeed ) > 7 :
if pickfeed == " 1 " or int ( pickfeed ) > 7 :
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
tmpdesc = feedme . entries [ i ] . description
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
st_pub = feedme . entries [ i ] . title . find ( ' ( ' )
st_end = feedme . entries [ i ] . title . find ( ' ) ' )
2015-05-22 08:32:51 +00:00
pub = feedme . entries [ i ] . title [ st_pub + 1 : st_end ] # +1 to not include (
2015-05-14 09:33:40 +00:00
#logger.fdebug('publisher: ' + re.sub("'",'', pub).strip()) #publisher sometimes is given within quotes for some reason, strip 'em.
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
vol_find = feedme . entries [ i ] . title . find ( ' vol. ' )
2015-05-22 08:32:51 +00:00
series = feedme . entries [ i ] . title [ st_end + 1 : vol_find ] . strip ( )
2015-05-14 09:33:40 +00:00
#logger.fdebug('series title: ' + series)
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
iss_st = feedme . entries [ i ] . title . find ( ' - ' , vol_find )
vol = re . sub ( ' \ . ' , ' ' , feedme . entries [ i ] . title [ vol_find : iss_st ] ) . strip ( )
2015-05-14 09:33:40 +00:00
#logger.fdebug('volume #: ' + str(vol))
2015-05-22 08:32:51 +00:00
issue = feedme . entries [ i ] . title [ iss_st + 3 : ] . strip ( )
2015-05-14 09:33:40 +00:00
#logger.fdebug('issue # : ' + str(issue))
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
#break it down to get the Size since it's available on THIS 32P feed only so far.
#when it becomes available in the new feeds, this will be working, for now it just nulls out.
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
sizestart = tmpdesc . find ( ' Size: ' )
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
justdigits = 0
if sizestart > = 0 :
sizeend = tmpdesc . find ( ' Leechers: ' )
sizestart + = 5 # to get to the end of the word 'Size:'
tmpsize = tmpdesc [ sizestart : sizeend ] . strip ( )
fdigits = re . sub ( " [^0123456789 \ .] " , " " , tmpsize ) . strip ( )
if ' . ' in fdigits :
decfind = fdigits . find ( ' . ' )
wholenum = fdigits [ : decfind ]
2015-05-22 08:32:51 +00:00
decnum = fdigits [ decfind + 1 : ]
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
else :
wholenum = fdigits
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
decnum = 0
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 ' MB ' in tmpsize :
wholebytes = int ( wholenum ) * 1048576
2015-05-22 08:32:51 +00:00
wholedecimal = ( int ( decnum ) * 1048576 ) / 100
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
justdigits = wholebytes + wholedecimal
else :
#it's 'GB' then
2015-05-22 08:32:51 +00:00
wholebytes = ( int ( wholenum ) * 1024 ) * 1048576
wholedecimal = ( ( int ( decnum ) * 1024 ) * 1048576 ) / 100
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
justdigits = wholebytes + wholedecimal
#this is not currently working for 32p
#Get the # of seeders.
#seedstart = tmpdesc.find('Seeders:')
#seedend = tmpdesc.find('Added:')
#seedstart +=8 # to get to the end of the word 'Seeders:'
#tmpseed = tmpdesc[seedstart:seedend].strip()
#seeddigits = re.sub("[^0123456789\.]", "", tmpseed).strip()
seeddigits = 0
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
else :
justdigits = None #size not available in follow-list rss feed
seeddigits = 0 #number of seeders not available in follow-list rss feed
if int ( mylar . MINSEEDS ) > = int ( seeddigits ) :
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
link = feedme . entries [ i ] . link
linkst = link . find ( ' &id ' )
2015-05-22 08:32:51 +00:00
linken = link . find ( ' & ' , linkst + 1 )
if linken == - 1 :
linken = len ( link )
newlink = re . sub ( ' &id= ' , ' ' , link [ linkst : linken ] ) . strip ( )
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
feeddata . append ( {
' site ' : picksite ,
2015-05-22 08:32:51 +00:00
' title ' : series . lstrip ( ) + ' ' + vol + ' # ' + issue ,
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
' volume ' : vol , # not stored by mylar yet.
' issue ' : issue , # not stored by mylar yet.
' link ' : newlink , #just the id for the torrent
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 ' : feedme . entries [ i ] . updated ,
' size ' : justdigits
} )
2014-04-14 17:59:27 +00:00
2015-05-22 08:32:51 +00:00
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-05-22 08:32:51 +00:00
rssdbupdate ( feeddata , totalcount , ' torrent ' )
2013-08-07 06:27:12 +00:00
else :
katinfo [ ' entries ' ] = torthekat
return katinfo
2013-07-30 04:57:37 +00:00
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 = [ ]
def _parse_feed ( site , url ) :
logger . fdebug ( ' [RSS] Fetching items from ' + site )
feedme = feedparser . parse ( url , agent = str ( mylar . USER_AGENT ) )
feedthis . append ( { " site " : site ,
" feed " : feedme } )
2013-07-30 04:57:37 +00:00
newznab_hosts = [ ]
if mylar . NEWZNAB == 1 :
for newznab_host in mylar . EXTRA_NEWZNABS :
2015-03-30 15:49:36 +00:00
logger . fdebug ( ' [RSS] newznab name: ' + str ( newznab_host [ 0 ] ) + ' - enabled: ' + str ( newznab_host [ 4 ] ) )
if str ( newznab_host [ 4 ] ) == ' 1 ' :
2013-07-30 04:57:37 +00:00
newznab_hosts . append ( newznab_host )
2015-03-21 14:09:34 +00:00
providercount = len ( newznab_hosts ) + int ( mylar . EXPERIMENTAL == 1 ) + int ( mylar . NZBSU == 1 ) + int ( mylar . DOGNZB == 1 )
logger . fdebug ( ' [RSS] You have enabled ' + str ( providercount ) + ' NZB RSS search providers. ' )
2013-07-30 04:57:37 +00:00
2015-03-21 14:09:34 +00:00
if mylar . EXPERIMENTAL == 1 :
2015-03-30 15:49:36 +00:00
max_entries = " 250 " if forcerss else " 50 "
_parse_feed ( ' experimental ' , ' http://nzbindex.nl/rss/alt.binaries.comics.dcp/?sort=agedesc&max= ' + max_entries + ' &more=1 ' )
2015-03-20 06:47:43 +00:00
2015-03-21 14:09:34 +00:00
if mylar . NZBSU == 1 :
2015-03-30 15:49:36 +00:00
num_items = " &num=100 " if forcerss else " " # default is 25
_parse_feed ( ' nzb.su ' , ' http://api.nzb.su/rss?t=7030&dl=1&i= ' + ( mylar . NZBSU_UID or ' 1 ' ) + ' &r= ' + mylar . NZBSU_APIKEY + num_items )
2013-07-30 04:57:37 +00:00
2015-03-21 14:09:34 +00:00
if mylar . DOGNZB == 1 :
2015-03-30 15:49:36 +00:00
num_items = " &num=100 " if forcerss else " " # default is 25
_parse_feed ( ' dognzb ' , ' https://dognzb.cr/rss.cfm?r= ' + mylar . DOGNZB_APIKEY + ' &t=7030 ' + num_items )
2015-03-21 14:09:34 +00:00
for newznab_host in newznab_hosts :
site = newznab_host [ 0 ] . rstrip ( )
2015-03-30 15:49:36 +00:00
( newznabuid , _ , newznabcat ) = ( newznab_host [ 3 ] or ' ' ) . partition ( ' # ' )
newznabuid = newznabuid or ' 1 '
newznabcat = newznabcat or ' 7030 '
2015-03-21 14:09:34 +00:00
# 11-21-2014: added &num=100 to return 100 results (or maximum) - unsure of cross-reliablity
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
_parse_feed ( site , newznab_host [ 1 ] . rstrip ( ) + ' /rss?t= ' + str ( newznabcat ) + ' &dl=1&i= ' + str ( newznabuid ) + ' &num=100&r= ' + newznab_host [ 2 ] . rstrip ( ) )
2015-03-30 15:49:36 +00:00
feeddata = [ ]
2015-03-21 14:09:34 +00:00
for ft in feedthis :
site = ft [ ' site ' ]
logger . fdebug ( ' [RSS] ( ' + site + ' ) now being updated... ' )
for entry in ft [ ' feed ' ] . entries :
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 ' ]
# Link
if site == ' experimental ' :
link = entry . enclosures [ 0 ] [ ' url ' ]
else :
# dognzb, nzb.su, newznab
link = entry . link
2015-05-22 08:32:51 +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
#Remove the API keys from the url to allow for possible api key changes
if site == ' dognzb ' :
link = re . sub ( mylar . DOGNZB_APIKEY , ' ' , link ) . strip ( )
else :
link = link [ : link . find ( ' &i= ' ) ] . strip ( )
2015-03-21 14:09:34 +00:00
feeddata . append ( { ' Site ' : site ,
' Title ' : entry . title ,
' Link ' : link ,
' Pubdate ' : entry . updated ,
' Size ' : size } )
# logger.fdebug(" Site: " + site)
# logger.fdebug(" Title: " + entry.title)
# logger.fdebug(" Link: " + link)
# logger.fdebug(" pubdate: " + entry.updated)
# logger.fdebug(" size: " + size)
logger . info ( ' [RSS] ( ' + site + ' ) ' + str ( len ( ft [ ' feed ' ] . entries ) ) + ' entries indexed. ' )
i = len ( feeddata )
2015-03-30 15:49:36 +00:00
if i :
2014-04-14 17:59:27 +00:00
logger . info ( ' [RSS] ' + str ( i ) + ' entries have been indexed and are now going to be stored for caching. ' )
2015-03-21 14:09:34 +00:00
rssdbupdate ( feeddata , i , ' usenet ' )
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.
if dataval [ ' site ' ] == ' 32P ' :
newlink = dataval [ ' link ' ]
else :
#store the hash/id from KAT
2015-05-22 08:32:51 +00:00
newlink = os . path . basename ( re . sub ( ' .torrent ' , ' ' , dataval [ ' link ' ] [ : dataval [ ' link ' ] . find ( ' ?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
newVal = { " Link " : newlink ,
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
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' Completed adding new data to RSS DB. Next add in ' + str ( mylar . RSS_CHECKINTERVAL ) + ' minutes ' )
2013-07-30 04:57:37 +00:00
return
2015-05-22 08:32:51 +00:00
def torrentdbsearch ( seriesname , issue , comicid = None , nzbprov = None ) :
2013-07-30 04:57:37 +00:00
myDB = db . DBConnection ( )
seriesname_alt = None
if comicid is None or comicid == ' None ' :
pass
else :
2013-08-19 06:14:47 +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 )
2015-05-22 08:32:51 +00:00
tsearch_seriesname = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ - \ ; \ / \\ = \ ? \ & \ . \ s] ' , ' % ' , tsearch_removed )
2014-12-01 17:23:49 +00:00
if mylar . PREFERRED_QUALITY == 0 :
tsearch = tsearch_seriesname + " % "
elif mylar . PREFERRED_QUALITY == 1 :
tsearch = tsearch_seriesname + " %c br % "
elif mylar . PREFERRED_QUALITY == 2 :
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 + " % "
2014-06-25 15:32:54 +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
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 mylar . ENABLE_32P :
tresults = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site= ' 32P ' " , [ tsearch ] )
2013-07-30 04:57:37 +00:00
if mylar . ENABLE_KAT :
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
tresults + = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site= ' KAT ' " , [ tsearch ] )
2013-08-11 05:31:41 +00:00
2013-08-19 06:14:47 +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 ' :
if tresults is None :
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 )
2015-05-22 08:32:51 +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 )
2014-12-01 17:23:49 +00:00
if mylar . PREFERRED_QUALITY == 0 :
AS_Alternate + = " % "
elif mylar . PREFERRED_QUALITY == 1 :
AS_Alternate + = " %c br % "
elif mylar . PREFERRED_QUALITY == 2 :
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
if mylar . ENABLE_32P :
tresults + = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site= ' 32P ' " , [ AS_Alternate ] )
2013-08-11 05:31:41 +00:00
if mylar . ENABLE_KAT :
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
tresults + = myDB . select ( " SELECT * FROM rssdb WHERE Title like ? AND Site= ' KAT ' " , [ AS_Alternate ] )
2013-08-11 05:31:41 +00:00
if tresults is None :
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' torrent search returned no results for ' + 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 :
torsplit = tor [ ' Title ' ] . split ( ' / ' )
2014-12-01 17:23:49 +00:00
if mylar . PREFERRED_QUALITY == 1 :
if ' cbr ' in tor [ ' Title ' ] :
logger . fdebug ( ' Quality restriction enforced [ cbr only ]. Accepting result. ' )
else :
logger . fdebug ( ' Quality restriction enforced [ cbr only ]. Rejecting result. ' )
elif mylar . PREFERRED_QUALITY == 2 :
if ' cbz ' in tor [ ' Title ' ] :
logger . fdebug ( ' Quality restriction enforced [ cbz only ]. Accepting result. ' )
else :
logger . fdebug ( ' Quality restriction enforced [ cbz only ]. Rejecting result. ' )
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' tor-Title: ' + tor [ ' Title ' ] )
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 :
if nzbprov != tor [ ' Site ' ] :
logger . fdebug ( ' this is a result from ' + str ( tor [ ' Site ' ] ) + ' , not the site I am looking for of ' + str ( nzbprov ) )
continue
2013-07-30 04:57:37 +00:00
#0 holds the title/issue and format-type.
2014-12-01 17:23:49 +00:00
ext_check = True # extension checker to enforce cbr/cbz filetype restrictions.
2013-07-30 04:57:37 +00:00
while ( i < len ( torsplit ) ) :
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
#we'll rebuild the string here so that it's formatted accordingly to be passed back to the parser.
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
logger . fdebug ( ' section( ' + str ( i ) + ' ): ' + torsplit [ i ] )
2014-01-16 20:25:02 +00:00
#remove extensions
titletemp = torsplit [ i ]
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
titletemp = re . sub ( ' cbr ' , ' ' , titletemp )
titletemp = re . sub ( ' cbz ' , ' ' , titletemp )
titletemp = re . sub ( ' none ' , ' ' , titletemp )
2014-02-26 19:48:50 +00:00
2015-05-22 08:32:51 +00:00
if i == 0 :
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
rebuiltline = titletemp
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
else :
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
rebuiltline = rebuiltline + ' ( ' + titletemp + ' ) '
2013-07-30 04:57:37 +00:00
i + = 1
2013-08-19 06:14:47 +00:00
2015-05-22 08:32:51 +00:00
if ext_check == False :
2014-12-01 17:23:49 +00:00
continue
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
logger . fdebug ( ' rebuiltline is : ' + rebuiltline )
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
foundname_mod = torsplit [ 0 ]
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 )
2015-05-22 08:32:51 +00:00
formatrem_seriesname = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ ; \ = \ ? \ .] ' , ' ' , seriesname_mod )
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
2015-05-22 08:32:51 +00:00
formatrem_torsplit = re . sub ( ' [ \' \ ! \ @ \ # \ $ \ % \ : \ ; \\ = \ ? \ .] ' , ' ' , foundname_mod )
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 )
2013-08-19 06:14:47 +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-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 ) :
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' matched to : ' + tor [ ' Title ' ] )
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 )
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
#the title on 32P has a mix-mash of crap...ignore everything after cbz/cbr to cleanit
2013-08-04 05:57:21 +00:00
ctitle = tor [ ' Title ' ] . find ( ' cbr ' )
if ctitle == 0 :
ctitle = tor [ ' Title ' ] . find ( ' cbz ' )
2014-01-16 20:25:02 +00:00
if ctitle == 0 :
ctitle = tor [ ' Title ' ] . find ( ' none ' )
2015-05-22 08:32:51 +00:00
if ctitle == 0 :
2014-01-16 20:25:02 +00:00
logger . fdebug ( ' cannot determine title properly - ignoring for now. ' )
continue
2013-08-04 05:57:21 +00:00
cttitle = tor [ ' Title ' ] [ : ctitle ]
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 tor [ ' Site ' ] == ' 32P ' :
st_pub = rebuiltline . find ( ' ( ' )
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
if st_pub < 2 and st_pub != - 1 :
st_end = rebuiltline . find ( ' ) ' )
2015-05-22 08:32:51 +00:00
rebuiltline = rebuiltline [ st_end + 1 : ]
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 ( {
2014-01-16 20:25:02 +00:00
' title ' : rebuiltline , #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
2015-05-22 08:32:51 +00:00
def nzbdbsearch ( seriesname , issue , comicid = None , nzbprov = None , searchYear = None , ComicVersion = None ) :
2013-07-30 04:57:37 +00:00
myDB = db . DBConnection ( )
seriesname_alt = None
if comicid is None or comicid == ' None ' :
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
if mylar . PREFERRED_QUALITY == 1 : filetype = ' cbr '
elif mylar . 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
2013-10-19 01:04:16 +00:00
def torsend2client ( seriesname , issue , seriesyear , linkit , site ) :
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
2013-10-19 01:04:16 +00:00
if linkit [ - 7 : ] != " torrent " : # and site != "KAT":
2013-07-30 04:57:37 +00:00
filename + = " .torrent "
if mylar . TORRENT_LOCAL and mylar . LOCAL_WATCHDIR is not 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
2013-07-30 04:57:37 +00:00
filepath = os . path . join ( mylar . LOCAL_WATCHDIR , filename )
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' filename for torrent set to : ' + filepath )
2013-07-30 04:57:37 +00:00
elif mylar . TORRENT_SEEDBOX and mylar . SEEDBOX_WATCHDIR is not None :
filepath = os . path . join ( mylar . CACHE_DIR , filename )
2013-08-19 06:14:47 +00:00
logger . fdebug ( ' filename for torrent set to : ' + filepath )
2013-07-30 04:57:37 +00:00
else :
2013-08-19 06:14:47 +00:00
logger . error ( ' No Local Watch Directory or Seedbox Watch Directory specified. Set it and try again. ' )
2013-07-30 04:57:37 +00:00
return " fail "
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
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
verify = True
2015-05-14 09:33:40 +00:00
if mylar . MODE_32P == 0 :
2015-05-14 16:22:23 +00:00
if mylar . KEYS_32P is None or mylar . PASSKEY_32P is None :
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 :
2015-05-22 08:32:51 +00:00
if any ( [ mylar . USERNAME_32P is None , mylar . USERNAME_32P == ' ' , mylar . PASSWORD_32P is None , mylar . 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 "
elif mylar . PASSKEY_32P is None or mylar . AUTHKEY_32P is None or mylar . KEYS_32P is None :
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 ( )
2015-05-14 09:33:40 +00:00
if mylar . PASSKEY_32P is None or mylar . AUTHKEY_32P is None or mylar . KEYS_32P is None :
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 ' ,
' torrent_pass ' : mylar . PASSKEY_32P ,
' authkey ' : mylar . AUTHKEY_32P ,
' id ' : linkit }
2015-05-22 08:32:51 +00:00
headers = None #{'Accept-encoding': 'gzip',
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
# 'User-Agent': str(mylar.USER_AGENT)}
else :
stfind = linkit . find ( ' ? ' )
if stfind == - 1 :
kat_referrer = helpers . torrent_create ( ' KAT ' , linkit )
2013-09-05 02:36:41 +00:00
else :
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
kat_referrer = linkit [ : stfind ]
logger . fdebug ( ' KAT Referer set to : ' + kat_referrer )
2015-05-22 08:32:51 +00:00
headers = { ' Accept-encoding ' : ' gzip ' ,
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
' Referer ' : kat_referrer }
url = helpers . torrent_create ( ' KAT ' , linkit )
payload = None
verify = False
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.
2015-04-19 23:39:02 +00:00
#disable SSL warnings - too many 'warning' messages about invalid certificates
2015-04-17 18:35:05 +00:00
try :
2015-04-19 23:39:02 +00:00
from lib . requests . packages . urllib3 import disable_warnings
2015-05-22 08:32:51 +00:00
disable_warnings ( )
2015-04-19 23:39:02 +00:00
except ImportError :
#this is probably not necessary and redudant, but leaving in for the time being.
2015-04-17 18:35:05 +00:00
from requests . packages . urllib3 . exceptions import InsecureRequestWarning
requests . packages . urllib3 . disable_warnings ( )
2015-04-19 23:39:02 +00:00
try :
from urllib3 . exceptions import InsecureRequestWarning
urllib3 . disable_warnings ( )
except ImportError :
logger . warn ( ' [EPIC FAILURE] Cannot load the requests module ' )
return " fail "
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
try :
r = requests . get ( url , params = payload , verify = verify , stream = True , headers = headers )
2013-09-05 02:36:41 +00:00
2013-07-30 04:57:37 +00:00
except Exception , e :
logger . warn ( ' Error fetching data from %s : %s ' % ( site , e ) )
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
if site == ' 32P ' :
if mylar . MODE_32P == 1 :
logger . info ( ' Attempting to re-authenticate against 32P and poll new keys as required. ' )
feed32p = auth32p . info32p ( reauthenticate = True )
feedinfo = feed32p . authenticate ( )
try :
r = requests . get ( url , params = payload , verify = verify , stream = True , headers = headers )
except Exception , e :
logger . warn ( ' Error fetching data from %s : %s ' % ( site , e ) )
return " fail "
else :
logger . warn ( ' [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: 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 == ' KAT ' :
if r . headers . get ( ' Content-Encoding ' ) == ' gzip ' :
buf = StringIO ( r . content )
f = gzip . GzipFile ( fileobj = buf )
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 )
2013-09-05 02:36:41 +00:00
2013-07-30 04:57:37 +00:00
if mylar . TORRENT_LOCAL :
return " pass "
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
elif mylar . TORRENT_SEEDBOX :
2015-05-22 08:32:51 +00:00
tssh = ftpsshup . putfile ( filepath , filename )
2013-07-30 04:57:37 +00:00
return tssh
2013-09-05 02:36:41 +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 ] )