cromize / beatport_tracktagger

Tag audio files with Beatport ID easily using fuzzy matching
MIT License
10 stars 4 forks source link

beaport throws some kind of error after about 30-45 tracks for me? #2

Closed zogith closed 5 years ago

zogith commented 5 years ago

I get an error like the following:

27/52 - 9115249_Deep_Space_Original_Mix.flac
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/duncan/Downloads/tmp/beatport_tracktagger/tracktagger.py", line 235, in worker
    work(item)
  File "/home/duncan/Downloads/tmp/beatport_tracktagger/tracktagger.py", line 198, in addTrackToDatabase
    track.getTags()
  File "/home/duncan/Downloads/tmp/beatport_tracktagger/tracktagger.py", line 67, in getTags
    self.title = tree.xpath('//*[@id="pjax-inner-wrapper"]/section/main/div[1]/div[1]/h1[1]/text()').pop()
IndexError: pop from empty list

about 30 - 50 files in, constistantly, so I cant tag my whole folder of 90+ files.. it doesn't seem dependent on the file, and I tried changing the threading amount, and even adding time.sleep() etc.. I'm not sure if it is the beatport site putting out invalid page after X requests or seconds or what.. this is python3.6 on Ubuntu 18.04

If I make smaller directories with files less files in them (about 20 or so).. it works fine.

thanks for this by the way! typing in tags for files I've paid for is a MAJOR PITA.. why dont beatport provide tagged flacs as an option?!!!!

cromize commented 5 years ago

It seems that I can't reproduce the bug. I added try except loop with 10 attempts, before it fails. You can try it now, but I think it didn't fix that. Need to test it on more devices.

Thank you for positive feedback. Very appreciated. Motivates me to add more stuff.