abbi031892 / periscope

Automatically exported from code.google.com/p/periscope
0 stars 0 forks source link

Please use a proper User-Agent to use the API error with BierDopje.py #141

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.periscope -f -l en *.avi
2.
3.

What is the expected output? What do you see instead?
ERROR:periscope.plugins.BierDopje:Error raised by plugin
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/periscope-0.2.4-py2.7.egg/periscope/plugins/BierDopje.py", line 69, in process
    subs = self.query(fname, langs)
  File "/usr/local/lib/python2.7/dist-packages/periscope-0.2.4-py2.7.egg/periscope/plugins/BierDopje.py", line 113, in query
    page = urllib2.urlopen(getShowId_url)
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 406, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 444, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 403: Please use a proper User-Agent to use the API. For 
more information see: 
http://www.bierdopje.com/forum/algemeen-developers/topic/10004-Useragents-verpli
cht-per-9-April-2012-/last
INFO:periscope.plugins.SubtitleDatabase:BierDopje writing 0 items to queue

What version of the product are you using? On what operating system?
latest

Please provide any additional information below.
The URL provided in the error message is translated by Google Translate as 
following:

User agents must at 9 April 2012 *

Dear developers, 

On April 9th we will our API policy in relation to repeated abuse tighten 
again. 

From that date, we expect that ALL HTTP requests done by automated processes a 
valid user agent contain. 

With this user-agent, we can see which application and which version, so we can 
see abuse which application and version problems here have so appropriate 
action can be taken against. 

Examples of user agents, right and wrong: 
My Super Cool Application
SuperSubDownloader/1.0
Python-urllib/2.7
-
Agent not supp song
Subsucker/1.0-git21ae2
libwww-perl/5.812
SubDLV2
SubIT v0.5
CakePHP
Zend_Http_Client
Mozilla/5.0 (Windows NT 6.1; WOW64; rv: 10.0.2) Gecko/20100101 Firefox/10.0.2

The color in the above statement speaks for itself 
Still like that last explain: your application should never, ever to do 
something else. That is not, and is usually used only to more discretion in the 
logs. 

Sure okay to occasionally perform some API calls with your browser to test, but 
if we are going to see a lot of requests from applications that otherwise do as 
what they really are will result in action. 

The orange entries are basically good, but not very clean because you 
undoubtedly multiple versions 2.x will give. A so-called "minor" version number 
is always recommended. The slash also, since this is the usual and unambiguous 
way of separating application and version. 

What will happen after April 9? 
After April 1, you will notice that applications with general / unspecified 
user agents will be significantly delayed. This can be through ratelimiting (x 
request per minute) or bandwidth limiting applications (download at 0.1 kb / s) 
be implemented. 

We believe that we have the deadline of one month should be enough for everyone 
to be able to implement. The application will continue to work if you do not, 
but then you / your users a lot of patience because it will not go as fast as 
before. 

This is perhaps the right time to once your application with (forced) 
auto-updating so that you always know that there are updates or even be forced 
to upgrade. The latter can be useful if you've been a critical bug that could 
potentially lead to a blockage of your API key. 

Why are you doing this? 
This is an action which has a number of reasons: 

Better overall use applications and above versions used
It can inform you that version X of Y is an application specific problem (eg 
repeated requests to 'getshowbyname')
For developers to learn how to properly hear deal with others - whether free - 
services. Anyone can scripting (with or without the manual).
It's a little hard ...

And remains in this? 
For now. We are in the background is trying to do something to excessively 
repeated requests. 

In version 3, we probably IP / key rate limits as you also have to introduce 
the Twitter API (eg). 

Suggestions are welcome of course. 

I have some questions, something is not clear to me whether ... 
That is, before you can even open a topic in this forum so we ask you to 
clarify.

Original issue reported on code.google.com by meokey2...@gmail.com on 13 Nov 2012 at 3:18

GoogleCodeExporter commented 8 years ago

Original comment by patrick....@gmail.com on 13 Nov 2012 at 3:22

GoogleCodeExporter commented 8 years ago

Original comment by patrick....@gmail.com on 18 Nov 2012 at 3:46