Skip to content

Commit

Permalink
Merge pull request #439 from ScuttleSE/master
Browse files Browse the repository at this point in the history
Fixes issue 439 (image fetching does not provide a proper user agent).
  • Loading branch information
cbanack authored Jul 18, 2016
2 parents 8528a86 + fb65e4b commit 2378c1c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/py/database/comicvine/cvdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import utils
from utils import is_string, sstr
from dbmodels import IssueRef, SeriesRef, Issue
from resources import Resources
import cvimprints

clr.AddReference('System')
Expand Down Expand Up @@ -426,6 +427,8 @@ def _query_image( ref, lasttry = False ):
try:
cvconnection.wait_until_ready() # throttle our request speed
request = WebRequest.Create(image_url_s)
request.UserAgent = "[ComicVineScraper, version " + \
Resources.SCRIPT_VERSION + "]"
response = request.GetResponse()
response_stream = response.GetResponseStream()
retval = Image.FromStream(response_stream)
Expand Down

0 comments on commit 2378c1c

Please sign in to comment.