forked from david/telegram-music-bot
remove Google Play Music button since its discontinued
This commit is contained in:
parent
12118c5dd3
commit
6904bf3635
9
music.py
9
music.py
@ -138,7 +138,6 @@ def button(update, context: CallbackContext):
|
|||||||
|
|
||||||
songlink = "https://song.link/{0}".format(sp_link)
|
songlink = "https://song.link/{0}".format(sp_link)
|
||||||
|
|
||||||
|
|
||||||
gpm = ask_for_credentials()
|
gpm = ask_for_credentials()
|
||||||
if not gpm.is_authenticated():
|
if not gpm.is_authenticated():
|
||||||
print("\n\nGPM fucked up somewhere\n\n")
|
print("\n\nGPM fucked up somewhere\n\n")
|
||||||
@ -170,10 +169,10 @@ def button(update, context: CallbackContext):
|
|||||||
search_results = re.findall(r'href=\"\/watch\?v=(.{11})', html_content.read().decode())
|
search_results = re.findall(r'href=\"\/watch\?v=(.{11})', html_content.read().decode())
|
||||||
yt_link = f"http://www.youtube.com/watch?v={search_results[0]}"
|
yt_link = f"http://www.youtube.com/watch?v={search_results[0]}"
|
||||||
|
|
||||||
if gpm_link:
|
# if gpm_link:
|
||||||
reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("Spotify", url = sp_link), InlineKeyboardButton("GPM", url = gpm_link), InlineKeyboardButton("YouTube", url = yt_link), InlineKeyboardButton("More", url = songlink)]])
|
# reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("Spotify", url = sp_link), InlineKeyboardButton("GPM", url = gpm_link), InlineKeyboardButton("YouTube", url = yt_link), InlineKeyboardButton("More", url = songlink)]])
|
||||||
|
# Google Play Music is no more, I hope the API still works for a while. I'll have to hunt for one for youtube music
|
||||||
if not gpm_link:
|
# if not gpm_link:
|
||||||
reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("Spotify", url = sp_link), InlineKeyboardButton("YouTube", url = yt_link), InlineKeyboardButton("More", url = songlink)]])
|
reply_markup = InlineKeyboardMarkup([[InlineKeyboardButton("Spotify", url = sp_link), InlineKeyboardButton("YouTube", url = yt_link), InlineKeyboardButton("More", url = songlink)]])
|
||||||
|
|
||||||
query.edit_message_reply_markup(reply_markup=reply_markup)
|
query.edit_message_reply_markup(reply_markup=reply_markup)
|
||||||
|
Loading…
Reference in New Issue
Block a user