-
Notifications
You must be signed in to change notification settings - Fork 325
(-) Skipping song if unavailable #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Can you show traceback? |
|
Sure. But don't pay attention on line numbers, because I've changed code a little bit. |
|
I have a proposal how to get info of disabled track. After some research, I got that we cannot get desktop DOM with specified offset. |
vk_api/audio.py
Outdated
| 'id': audio['id'], | ||
| 'url': link | ||
| }) | ||
| if 'audio_item_disabled' not in audio["class"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's make
if 'audio_item_disabled' in audio['class']:
continue
ai_artist = audio.select('.ai_artist')
...
vk_api/audio.py
Outdated
| if 'audio_item_disabled' in audio["class"]: | ||
| # TODO: implement getting data of unavailable track | ||
| continue | ||
| else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can delete else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't want to make any more changes under else. I'm gonna just replace lines 132-133 by implemented code in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else block is not needed, until it's not implemented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deal
|
Can you squash commits? |
(+) Preparing for impl of fetching unavailable data (~) Deleting else
|
Looks like GitHub has ability to squash PR's commits. 👍 |
If song is not available due to requests of the copyright holder it has following tag:
<div class="audio_item audio_item_disabled"></div>so we can't extract any info from it andaudio.select('.ai_artist')will return empty list. After that we'll get IndexError: list index out of range.So I think it'll be good to check if tag is not containing class named 'audio_item_disabled'.
But how can we tell user about this by API?