We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5577cef + 496af39 commit 316460bCopy full SHA for 316460b
youtube.py
@@ -11,15 +11,16 @@
11
12
import requests
13
from bs4 import BeautifulSoup
14
-
+'''
15
headers = {
16
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36'}
17
18
query = input('Enter the song to be played: ')
19
query = query.replace(' ', '+')
20
21
# search for the best similar matching video
22
url = 'https://www.youtube.com/results?search_query=' + query
-source_code = requests.get(url, headers=headers, timeout=15)
23
+source_code = requests.get(url,timeout=15)
24
plain_text = source_code.text
25
soup = BeautifulSoup(plain_text, "html.parser")
26
0 commit comments