Skip to content

Instantly share code, notes, and snippets.

@rodrigo-x
Last active January 23, 2021 07:02
Show Gist options
  • Save rodrigo-x/06d49e551b12a6beba10c2f6c4216aa5 to your computer and use it in GitHub Desktop.
Save rodrigo-x/06d49e551b12a6beba10c2f6c4216aa5 to your computer and use it in GitHub Desktop.
Getting youtube subscriptions auto.
# install python requirement libs
# shell$> sudo pip install -r requirement_python.txt
webbrowser
tkinter
#!/usr/bin/env python3
import webbrowser
import tkinter as tk
from tkinter import messagebox as mb
def callback():
url = 'https://www.youtube.com/feed/subscriptions'
if mb.askyesno('Abrir o browser', 'Deseja abrir o YouTube?'):
# Specific Browser
# windows-default = default windows browser.
webbrowser.get('windows-default').open(url)
else:
mb.showinfo('Abrir o Browser', 'Comando abortado.')
tk.Button(text='Clique', command=callback).pack(fill=tk.X)
tk.mainloop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment