mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
News download: Add a default Accept header to all requests
This commit is contained in:
parent
1b89baf337
commit
9dab6807be
@ -341,7 +341,7 @@ def random_user_agent():
|
||||
def browser(honor_time=True, max_time=2, mobile_browser=False, user_agent=None):
|
||||
'''
|
||||
Create a mechanize browser for web scraping. The browser handles cookies,
|
||||
refresh requests and ignores robots.txt. Also uses proxy if avaialable.
|
||||
refresh requests and ignores robots.txt. Also uses proxy if available.
|
||||
|
||||
:param honor_time: If True honors pause time in refresh requests
|
||||
:param max_time: Maximum time in seconds to wait during a refresh request
|
||||
|
@ -398,7 +398,9 @@ class BasicNewsRecipe(Recipe):
|
||||
return br
|
||||
|
||||
'''
|
||||
return browser(*args, **kwargs)
|
||||
br = browser(*args, **kwargs)
|
||||
br.addheaders += [('Accept', '*/*')]
|
||||
return br
|
||||
|
||||
def clone_browser(self, br):
|
||||
'''
|
||||
|
Loading…
x
Reference in New Issue
Block a user