Rick Summerhill | 8 Jun 2012 16:48
Favicon

Problem in search_movie.py?

I've been using IMDbPY as a tool for several months, although I don't know much about Python.  I've altered
the script search_movie.py to do what I need it to do, and it has been working fine for several months.  All of
a sudden it is failing, returning no movies.  Going back to the original search_movie.py and running it
with the argument 'Wind', the following is output:

-----------
2012-06-08 10:37:29,849 CRITICAL [imdbpy]
/Library/Python/2.7/site-packages/IMDbPY-4.8.2-py2.7-macosx-10.7-intel.egg/imdb/_exceptions.py:35:
IMDbDataAccessError exception raised; args: ({'url':
'http://akas.imdb.com/find?s=tt;mx=20;q=Wind', 'error type': 'http_error_default', 'errcode':
503, 'headers': <httplib.HTTPMessage instance at 0x108713170>, 'proxy': '', 'errmsg': 'Service
Temporarily Unavailable'},); kwds: {}
None
Probably you're not connected to Internet.  Complete error report:
{'url': 'http://akas.imdb.com/find?s=tt;mx=20;q=Wind', 'error type': 'http_error_default',
'errcode': 503, 'headers': <httplib.HTTPMessage instance at 0x108713170>, 'proxy': '', 'errmsg':
'Service Temporarily Unavailable'}
-----------

Running the url 'http://akas.imdb.com/find?s=tt;mx=20;q=Wind' by hand in my browser, returns
basically an empty error page.  I looked through the parsing code, and it indicates, in a comment, that the
url should look something like:
'http://akas.imdb.com/find?q=Wind;s=tt;mx=20'.  This url returns a valid page which can be parsed.

Has something changed in IMDb to cause this problem, and is there an easy fix, even temporary in nature, that
can be applied?

Thanks,

--Rick
(Continue reading)

Mayank | 11 Jun 2012 09:21
Picon
Favicon

Re: Problem in search_movie.py?

> Running the url 'http://akas.imdb.com/find?s=tt;mx=20;q=Wind' by hand in my 
browser, returns
> basically an empty error page.  I looked through the parsing code, and it 
indicates, in a comment, that the
> url should look something like:
> 'http://akas.imdb.com/find?q=Wind;s=tt;mx=20'.  This url returns a valid page 
which can be parsed.

Hi Rick,

1. search for .../imdb/parser/http/__init__.py  in your installation directory.
2. within __init__.py, search for a function: 
        _get_search_content
3. within the function, 
   change 
        params = 's=%s;mx=%s;q=%s' % (kind, str(results), quote_plus(ton))
   To
        params = 'q=%s;s=%s;mx=%s' % (quote_plus(ton), kind, str(results))

The IMDB query URL keeps changing once in a rare while. This should solve the 
problem at hand.

-Mayank.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
(Continue reading)

Ivan Tadic | 6 Sep 2012 17:21
Picon

Re: Problem in search_movie.py?

Thank a lot Mayank, I had the same Problem !

Ivan

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
Davide Alberani | 6 Sep 2012 19:42
Picon
Gravatar

Re: Problem in search_movie.py?

On Thu, Sep 6, 2012 at 5:21 PM, Ivan Tadic <padawan@...> wrote:
>
> Thank a lot Mayank, I had the same Problem !

Thanks for the reports.
It should be fixed in the mercurial repository.

The problem seems to affect a limited number of countries.

--

-- 
Davide Alberani <davide.alberani@...>  [PGP KeyID: 0x465BFD47]
http://www.mimante.net/

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

Gmane