Skip to content

Commit 316460b

Browse files
Merge pull request #283 from rtatu/master
removed headers from youtube.py
2 parents 5577cef + 496af39 commit 316460b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

youtube.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@
1111

1212
import requests
1313
from bs4 import BeautifulSoup
14-
14+
'''
1515
headers = {
1616
'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+
'''
1718
query = input('Enter the song to be played: ')
1819
query = query.replace(' ', '+')
1920

2021
# search for the best similar matching video
2122
url = 'https://www.youtube.com/results?search_query=' + query
22-
source_code = requests.get(url, headers=headers, timeout=15)
23+
source_code = requests.get(url,timeout=15)
2324
plain_text = source_code.text
2425
soup = BeautifulSoup(plain_text, "html.parser")
2526

0 commit comments

Comments
 (0)