aboutsummaryrefslogtreecommitdiff
path: root/src/web/lib/crawler.py
diff options
context:
space:
mode:
authorCédric Bonhomme <cedric@cedricbonhomme.org>2016-01-11 15:22:26 +0100
committerCédric Bonhomme <cedric@cedricbonhomme.org>2016-01-11 15:22:26 +0100
commit6d0e7c8fe0da4ce96fb9c7df3ab9c970f3a2913d (patch)
tree36d6ff44e909aa00bcb52adbe1f2fe5ede1f53f3 /src/web/lib/crawler.py
parentMoved the crawler in the parent folder. (diff)
parentfixing stuffs (diff)
downloadnewspipe-6d0e7c8fe0da4ce96fb9c7df3ab9c970f3a2913d.tar.gz
newspipe-6d0e7c8fe0da4ce96fb9c7df3ab9c970f3a2913d.tar.bz2
newspipe-6d0e7c8fe0da4ce96fb9c7df3ab9c970f3a2913d.zip
Merge pull request #30 from jaesivsm/master
misc fixes on crawlers and use of User-Agent
Diffstat (limited to 'src/web/lib/crawler.py')
-rw-r--r--src/web/lib/crawler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/web/lib/crawler.py b/src/web/lib/crawler.py
index 90a268e8..979ccbfc 100644
--- a/src/web/lib/crawler.py
+++ b/src/web/lib/crawler.py
@@ -52,7 +52,7 @@ class AbstractCrawler:
auth=self.auth, data=json.dumps(data,
default=default_handler),
headers={'Content-Type': 'application/json',
- 'User-Agent': 'jarr'})
+ 'User-Agent': conf.USER_AGENT})
def wait(self, max_wait=300, checks=5, wait_for=2):
checked, second_waited = 0, 0
@@ -217,7 +217,7 @@ class CrawlerScheduler(AbstractCrawler):
def prepare_headers(self, feed):
"""For a known feed, will construct some header dictionnary"""
- headers = {'User-Agent': 'jarr/crawler'}
+ headers = {'User-Agent': conf.USER_AGENT}
if feed.get('last_modified'):
headers['If-Modified-Since'] = feed['last_modified']
if feed.get('etag') and 'pyagg' not in feed['etag']:
bgstack15