mirror of
https://github.com/JimmXinu/FanFicFare.git
synced 2025-12-30 20:52:57 +01:00
Add User-agent="FFDL/1.7" for all adapters. (Remove from specific adapters.)
This commit is contained in:
parent
20c7e7f075
commit
7e35d0b710
3 changed files with 2 additions and 10 deletions
|
|
@ -37,11 +37,6 @@ class HPFanficArchiveComAdapter(BaseSiteAdapter):
|
|||
def __init__(self, config, url):
|
||||
BaseSiteAdapter.__init__(self, config, url)
|
||||
|
||||
# hpfanficarchive.com blocks the default user-agent. However,
|
||||
# when asked, they said it was just general anti-spam, not
|
||||
# targeted at us. That lets me do this in good conscience:
|
||||
self.opener.addheaders = [('User-agent', 'FFDL/1.7')]
|
||||
|
||||
self.decode = ["Windows-1252",
|
||||
"utf8"] # 1252 is a superset of iso-8859-1.
|
||||
# Most sites that claim to be
|
||||
|
|
|
|||
|
|
@ -37,11 +37,6 @@ class NCISFictionNetAdapter(BaseSiteAdapter):
|
|||
def __init__(self, config, url):
|
||||
BaseSiteAdapter.__init__(self, config, url)
|
||||
|
||||
# ncisfiction.net blocks the default user-agent. However,
|
||||
# when asked, they said it was just general anti-spam, not
|
||||
# targeted at us. That lets me do this in good conscience:
|
||||
self.opener.addheaders = [('User-agent', 'FFDL/1.7')]
|
||||
|
||||
self.decode = ["iso-8859-1",
|
||||
"Windows-1252"] # 1252 is a superset of iso-8859-1.
|
||||
# Most sites that claim to be
|
||||
|
|
|
|||
|
|
@ -77,6 +77,8 @@ class BaseSiteAdapter(Configurable):
|
|||
self.is_adult=False
|
||||
|
||||
self.opener = u2.build_opener(u2.HTTPCookieProcessor(),GZipProcessor())
|
||||
## Specific UA because too many sites are blocking the default python UA.
|
||||
self.opener.addheaders = [('User-agent', 'FFDL/1.7')]
|
||||
self.storyDone = False
|
||||
self.metadataDone = False
|
||||
self.story = Story(configuration)
|
||||
|
|
|
|||
Loading…
Reference in a new issue