From ccc07676fbbca6c246ebc8158db03312c4c04e70 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 3 Jul 2013 09:51:39 -0500 Subject: [PATCH] Phoenixsong can have individual chapters req login. Add force_login parameter. --- defaults.ini | 6 ++++++ .../adapters/adapter_phoenixsongnet.py | 3 ++- plugin-defaults.ini | 16 +++++++++++----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/defaults.ini b/defaults.ini index 1b5d0961..4b99caf1 100644 --- a/defaults.ini +++ b/defaults.ini @@ -1216,6 +1216,12 @@ extraships:Harry Potter/Ginny Weasley #username:YourName #password:yourpassword +## phoenixsong.net, oddly, can have high rated chapters (login +## required) in the middle of a lower rated story. Use this to force +## FFDL to always login to phoenixsong.net so those stories download +## correctly. +#force_login:true + [www.potionsandsnitches.net] ## Site dedicated to these categories/characters/ships extracategories:Harry Potter diff --git a/fanficdownloader/adapters/adapter_phoenixsongnet.py b/fanficdownloader/adapters/adapter_phoenixsongnet.py index cd1cf012..10c1823d 100644 --- a/fanficdownloader/adapters/adapter_phoenixsongnet.py +++ b/fanficdownloader/adapters/adapter_phoenixsongnet.py @@ -112,6 +112,8 @@ class PhoenixSongNetAdapter(BaseSiteAdapter): logger.debug("URL: "+url) try: + if self.getConfig('force_login'): + self.performLogin(url) data = self._fetchUrl(url) except urllib2.HTTPError, e: if e.code == 404: @@ -123,7 +125,6 @@ class PhoenixSongNetAdapter(BaseSiteAdapter): # need to log in for this one. self.performLogin(url) data = self._fetchUrl(url) - # use BeautifulSoup HTML parser to make everything easier to find. soup = bs.BeautifulSoup(data) diff --git a/plugin-defaults.ini b/plugin-defaults.ini index ffa2a692..f42e6909 100644 --- a/plugin-defaults.ini +++ b/plugin-defaults.ini @@ -654,6 +654,11 @@ cover_exclusion_regexp:/images/.*?ribbon.gif ## Site dedicated to these categories/characters/ships extracategories:Harry Potter +## Some sites do not require a login, but do require the user to +## confirm they are adult for adult content. In commandline version, +## this should go in your personal.ini, not defaults.ini. +#is_adult:true + ## Some sites require login (or login for some rated stories) The ## program can prompt you, or you can save it in config. In ## commandline version, this should go in your personal.ini, not @@ -661,11 +666,6 @@ extracategories:Harry Potter #username:YourName #password:yourpassword -## Some sites also require the user to confirm they are adult for -## adult content. In commandline version, this should go in your -## personal.ini, not defaults.ini. -#is_adult:true - [fanfic.potterheadsanonymous.com] ## Site dedicated to these categories/characters/ships extracategories:Harry Potter @@ -1200,6 +1200,12 @@ extraships:Harry Potter/Ginny Weasley #username:YourName #password:yourpassword +## phoenixsong.net, oddly, can have high rated chapters (login +## required) in the middle of a lower rated story. Use this to force +## FFDL to always login to phoenixsong.net so those stories download +## correctly. +#force_login:true + [www.potionsandsnitches.net] ## Site dedicated to these categories/characters/ships extracategories:Harry Potter