Welcome, Guest
News and Announcements

TOPIC: Comic Vine Scraper

Comic Vine Scraper 1 year 4 months ago #45818

Quick fix would be a simple change in the file "%appdata%\cYo\ComicRack\Scripts\Comic Vine Scraper\cvdb.py" (%appdata% works in notepad) after Line 428, adding request.UserAgent = "cvs". It should look like this:
cvconnection.wait_until_ready() # throttle our request speed
         request = WebRequest.Create(image_url_s)
         request.UserAgent = "cvs"
         response = request.GetResponse()
         response_stream = response.GetResponseStream()
         retval = Image.FromStream(response_stream)

Worked for me, at least.
The administrator has disabled public write access.
The following user(s) said Thank You: oraclexview, romsnesrom, jericko, krandor, docdoom, jkthemac, beardyandy

Comic Vine Scraper 1 year 4 months ago #45819

  • krandor
  • krandor's Avatar
  • Offline
  • Gold Boarder
  • Posts: 204
  • Thank you received: 21
  • Karma: 4
RobertEdelmann1974 wrote:
Quick fix would be a simple change in the file "%appdata%\cYo\ComicRack\Scripts\Comic Vine Scraper\cvdb.py" (%appdata% works in notepad) after Line 428, adding request.UserAgent = "cvs". It should look like this:
cvconnection.wait_until_ready() # throttle our request speed
         request = WebRequest.Create(image_url_s)
         request.UserAgent = "cvs"
         response = request.GetResponse()
         response_stream = response.GetResponseStream()
         retval = Image.FromStream(response_stream)

Worked for me, at least.

Thanks for that. I'll have to try it out tonight.
The administrator has disabled public write access.

Comic Vine Scraper 1 year 4 months ago #45820

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 906
  • Thank you received: 182
  • Karma: 37
RobertEdelmann1974 wrote:
Quick fix would be a simple change in the file "%appdata%\cYo\ComicRack\Scripts\Comic Vine Scraper\cvdb.py" (%appdata% works in notepad) after Line 428, adding request.UserAgent = "cvs". It should look like this:
cvconnection.wait_until_ready() # throttle our request speed
         request = WebRequest.Create(image_url_s)
         request.UserAgent = "cvs"
         response = request.GetResponse()
         response_stream = response.GetResponseStream()
         retval = Image.FromStream(response_stream)

Worked for me, at least.
Great work. I was looking for the spot where the code edit would need to be done earlier this morning before heading off to work with no success. If it worked for you it should work for everyone. I'll test first chance I get later today. Much karma headed your way today! Lol
The administrator has disabled public write access.

Comic Vine Scraper 1 year 4 months ago #45821

  • Scuttle
  • Scuttle's Avatar
  • Offline
  • Junior Boarder
  • Posts: 24
  • Thank you received: 14
  • Karma: 6
I refined the code a bit. This will make the script reply the same way when fetching images as when doing the API-requests

In cvdb.py, first add a line under line 17
from resources import Resources
from utils import is_string, sstr 
from dbmodels import IssueRef, SeriesRef, Issue
from resources import Resources
import cvimprints

Then under line 428, add these two lines:
request.UserAgent = "[ComicVineScraper, version " + \
         Resources.SCRIPT_VERSION + "]" 
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)
Last Edit: 1 year 4 months ago by Scuttle.
The administrator has disabled public write access.
The following user(s) said Thank You: oraclexview, JudgeChief, romsnesrom, ianandout, jericko, lahonda_99, krandor, jkthemac, RobertEdelmann1974, keving and this user have 1 others thankyou

Comic Vine Scraper 1 year 4 months ago #45822

  • oraclexview
  • oraclexview's Avatar
  • Offline
  • Moderator
  • aka SoundWave
  • Posts: 906
  • Thank you received: 182
  • Karma: 37
Scuttle wrote:
I refined the code a bit. This will make the script reply the same way when fetching images as when doing the API-requests

In cvdb.py, first add a line under line 17
from utils import is_string, sstr 
from dbmodels import IssueRef, SeriesRef, Issue
from resources import Resources
import cvimprints

Then under line 428, add these two lines:
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)
I do love code refinements. Thanks! More karma being handed out today.
The administrator has disabled public write access.

Comic Vine Scraper 1 year 4 months ago #45823

  • cbanack
  • cbanack's Avatar
  • Offline
  • Platinum Boarder
  • Posts: 1328
  • Thank you received: 508
  • Karma: 182
Yes, this is exactly what the 'official' build will look like.
Scuttle wrote:
I refined the code a bit. This will make the script reply the same way when fetching images as when doing the API-requests

In cvdb.py, first add a line under line 17
from resources import Resources
from utils import is_string, sstr 
from dbmodels import IssueRef, SeriesRef, Issue
from resources import Resources
import cvimprints

Then under line 428, add these two lines:
request.UserAgent = "[ComicVineScraper, version " + \
         Resources.SCRIPT_VERSION + "]" 
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)
Last Edit: 1 year 4 months ago by cbanack.
The administrator has disabled public write access.
The following user(s) said Thank You: romsnesrom, jericko, lahonda_99, RobertEdelmann1974, Scuttle

Comic Vine Scraper 1 year 4 months ago #45824

  • beardyandy
  • beardyandy's Avatar
  • Offline
  • Junior Boarder
  • Posts: 20
  • Thank you received: 1
  • Karma: 0
Apologies if this is wrong but just to confirm it's tested as working here. Thank you
The administrator has disabled public write access.

Comic Vine Scraper 1 year 4 months ago #45825

  • jericko
  • jericko's Avatar
  • Offline
  • Senior Boarder
  • Posts: 41
  • Thank you received: 1
  • Karma: 1
beardyandy wrote:
Apologies if this is wrong but just to confirm it's tested as working here. Thank you

Yes, I just made the changes in Notepad++ (but I am sure you could use notepad) and it works perfect now!

Big Thank You to cbanack, Scuttle, and RobertEdelmann1974!
The administrator has disabled public write access.

Comic Vine Scraper 1 year 4 months ago #45828

  • Drod
  • Drod's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 1
  • Karma: 0
Thanks for the quick fix guys!!!
The administrator has disabled public write access.

Comic Vine Scraper 1 year 4 months ago #45829

  • solidus0079
  • solidus0079's Avatar
  • Offline
  • Senior Boarder
  • Posts: 76
  • Thank you received: 3
  • Karma: 1
Scuttle wrote:
I refined the code a bit. This will make the script reply the same way when fetching images as when doing the API-requests

In cvdb.py, first add a line under line 17
from resources import Resources
from utils import is_string, sstr 
from dbmodels import IssueRef, SeriesRef, Issue
from resources import Resources
import cvimprints

Then under line 428, add these two lines:
request.UserAgent = "[ComicVineScraper, version " + \
         Resources.SCRIPT_VERSION + "]" 
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)
A true triumph of the human spirit!
The administrator has disabled public write access.
Time to create page: 0.229 seconds

Who's Online

We have 281 guests and one member online