Skip to content

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

Open
billchenchina wants to merge 1 commit into
muammar:masterfrom
billchenchina:non-youtube
Open

Handle cases where youtube_url may be from other providers (e.g., music.163.com)#473
billchenchina wants to merge 1 commit into
muammar:masterfrom
billchenchina:non-youtube

Conversation

@billchenchina

@billchenchina billchenchina commented Oct 15, 2024

Copy link
Copy Markdown
  • 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
Copy Markdown
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