Skip to content

Commit

Permalink
Entirely remove REQUEST_DELAY for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
djdembeck committed Sep 2, 2021
1 parent 2220732 commit 8b575c0
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
from update_tools import UpdateTool
from urls import SiteUrl

VERSION_NO = '2021.08.30.3'

# Delay used when requesting HTML,
# may be good to have to prevent being banned from the site
REQUEST_DELAY = 1
VERSION_NO = '2021.09.02.1'

# Starting value for score before deductions are taken.
INITIAL_SCORE = 100
Expand Down Expand Up @@ -90,7 +86,7 @@ def findDateInTitle(self, title):
return None

def doSearch(self, ctx, url):
html = HTML.ElementFromURL(url, sleep=REQUEST_DELAY)
html = HTML.ElementFromURL(url)
found = []

for r in html.xpath('//div[a/img[@class="yborder"]]'):
Expand Down Expand Up @@ -248,7 +244,7 @@ def update(self, metadata, media, lang, force=False):
url = ctx['AUD_BOOK_INFO'] % metadata.id

try:
html = HTML.ElementFromURL(url, sleep=REQUEST_DELAY)
html = HTML.ElementFromURL(url)
except Exception as e:
log.error(e)

Expand Down Expand Up @@ -349,7 +345,7 @@ def create_search_url(self, ctx, helper):
return searchUrl

def doSearch(self, ctx, url):
html = HTML.ElementFromURL(url, sleep=REQUEST_DELAY)
html = HTML.ElementFromURL(url)
found = []

# Set append to the returned array from this function
Expand Down Expand Up @@ -607,7 +603,6 @@ def scrape_book_metadata(self, ctx, helper, html):
helper.date = date
helper.genre_child = genre_child
helper.genre_parent = genre_parent
# helper.url = murl
helper.narrator = narrator
helper.series = series
helper.studio = studio
Expand Down

0 comments on commit 8b575c0

Please sign in to comment.