Skip to content
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

Handle cases where youtube_url may be from other providers (e.g., music.163.com) #473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

billchenchina
Copy link

@billchenchina billchenchina commented Oct 15, 2024

  • Updated logic to check for the 'v' parameter in the query.
  • If 'v' is not present, the full URL is printed instead.

Fixes:

$ mkchromecast -s -y 'http://music.163.com/#/song?id=2619645817'
Mkchromecast v0.3.9
The Youtube URL chosen: http://music.163.com/album/245695664/
Traceback (most recent call last):
  File "/usr/bin/mkchromecast", line 311, in <module>
    mk()
  File "/usr/bin/mkchromecast", line 59, in __init__
    self.audio_linux()
  File "/usr/bin/mkchromecast", line 92, in audio_linux
    import mkchromecast.audio
  File "/usr/lib/python3/dist-packages/mkchromecast/audio.py", line 85, in <module>
    video = query["v"][0]
            ~~~~~^^^^^
KeyError: 'v'

…ic.163.com)

- Updated logic to check for the 'v' parameter in the query.
- If 'v' is not present, the full URL is printed instead.
@billchenchina
Copy link
Author

Or, maybe we should not parse the URL and print the v part considering https://youtu.be/{VIDEO_ID} format?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant