mirror of
https://github.com/HappyTanuki/BumbleCee.git
synced 2025-10-26 09:55:14 +00:00
logger 연결 완료
This commit is contained in:
22
youtube-search.py
Normal file
22
youtube-search.py
Normal file
@@ -0,0 +1,22 @@
|
||||
import sys
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit()
|
||||
|
||||
import urllib.parse
|
||||
|
||||
def uri_validator(x):
|
||||
try:
|
||||
result = urllib.parse.urlparse(x)
|
||||
return all([result.scheme, result.netloc])
|
||||
except AttributeError:
|
||||
return False
|
||||
|
||||
if uri_validator(sys.argv[1]) == True:
|
||||
exit()
|
||||
|
||||
from youtube_search import YoutubeSearch
|
||||
|
||||
results = YoutubeSearch(sys.argv[1], max_results=10).to_dict()
|
||||
|
||||
print(results[0]["id"])
|
||||
Reference in New Issue
Block a user