· 4 years ago · Jul 06, 2021, 12:48 PM
1### ********************************************************* ###
2
3"""
4skript Author: tmm88
5jaar: 2021/7/6
6
7language: python
8
9tools used:
10* os.system python3 python2 pip3 pip2
11* youtube-search-python ffmpeg youtube-dl
12
13description (abstrakt):
14* performs a search in youtube throughout youtube api
15* retrieves a dictionary with the search results
16* grabs the contents of that search into a dictionary
17* iterates throughout this dictionary
18* stores the result of the url searches into variables
19* download those link results using youtube-dl and ffmpeg
20"""
21
22### ********************************************************* ###
23
24#IMPORT SKRIPT CORE DEPENDENCIES
25import json
26import os
27import sys
28
29### ********************************************************* ###
30
31### IMPORT LIBRARY
32from youtubesearchpython import VideosSearch
33
34### ********************************************************* ###
35
36### SCRIPT ARGUMENTEN IN DAS UBBER PYTHON. RUN PYTHON getYoutubeVideos.py search-tag und dich verunsichern
37### EIN KLEINEN SPUNKTEN SCHEISSER MELTE MIT SIE CRUCIFIX
38youtubeSearchTag = sys.argv[1]
39
40### ********************************************************* ###
41
42### MULTI-LINE CODE FUR SCRIPT REQUIREMENT INSTALAZIONEN IN DAS UBBER ARCH LINUX
43
44"""
45os.system("sudo pacman -S python python3 python2")
46os.system("sudo pacman -S python2-pip python3-pip python-pip")
47os.system("sudo pacman -S youtube-dl ffmpeg")
48
49### ********************************************************* ###
50### ********************************************************* ###
51
52os.system("sudo pip3 install youtube-search-python")
53os.system("sudo pip2 install youtube-search-python")
54os.system("sudo pip install youtube-search-python")
55"""
56
57### ********************************************************* ###
58
59### RETURNS A DICTIONARY IN JSON WITH THE PARAMETER FUNZIONEN IN DAS UBBER ABENGLICHT
60results=VideosSearch(youtubeSearchTag, limit=100).result()
61#print(myJsonData)
62#print(myJsonData.result)
63
64### ********************************************************* ###
65
66### ITERATES THROUGHOUT DAS UBBER FANTASTICHEN UBBER SKRIPT IN DAS UN IKONIKEN UBBER SCHNELL MIT MEIN FLAMMEN ARGANEL
67for key in results:
68 print(results[key])
69 print(results.get('link'))
70 """os.system("cd ~/Videos; youtube-dl " + results.get('link'))"""
71
72### ********************************************************* ###
73