fzakaria / HypeScript

Python HypeMachine script downloader
www.fzakaria.com
55 stars 21 forks source link

IndexError: list out of range #4

Closed nitinpuri777 closed 12 years ago

nitinpuri777 commented 12 years ago

Hi there,

I've been using your script successfully for a few weeks now and all of a sudden I'm hitting this error. I haven't changed anything about the way I'm executing it (in fact I'd set it up in cron without problems) and for some reason I get the following output now when I try to run the hypeScript. Your script is incredibly helpful and I'd love to get it up and working again if possible.

Traceback (most recent call last): File "hypeme.py", line 159, in main() File "hypeme.py", line 152, in main scraper.start() File "hypeme.py", line 73, in start self.parse_html(html_data) File "hypeme.py", line 140, in parse_html title = songMatches[i] IndexError: list index out of range

Please let me know if you have any idea why this isn't working.

BenjaminDavison commented 12 years ago

Hi,

If you replace these sections of parse_html() with the correct regex it should start working again.

    idMatches = re.findall("[ \t]id:\'(\w*)(?=\')", html_contents)
    keyMatches = re.findall("(?<=\tkey: \')\w*(?=\')", html_contents)
    songMatches= re.findall("[ \t]song:\'.*(?=\')", html_contents)
    artistMatches= re.findall("[ \t]artist:\'.*(?=\')", html_contents)

Regards,

fzakaria commented 12 years ago

fixed with latest submission. I updated to stronger patterns.

nitinpuri777 commented 12 years ago

Thanks so much. I'll have to try it when I get home.

Best,

Nitin On Jun 29, 2012 5:44 AM, "Farid Zakaria" < reply@reply.github.com> wrote:

fixed with latest submission. I updated to stronger patterns.


Reply to this email directly or view it on GitHub: https://github.com/fzakaria/HypeScript/issues/4#issuecomment-6647591