Skip to content

Commit 9517f00

Browse files
committed
add new tutorial youtube
1 parent 9cc530d commit 9517f00

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

python-tutorials/project_video.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from flask import Flask, request
2+
from microservices import service_flask
3+
4+
app = Flask(__name__)
5+
6+
@app.route("/<path:path>", methods=['GET', 'POST'])
7+
8+
def service(path):
9+
return service(request)
10+
11+
if __name__ == "__main__":
12+
app.run(host="0.0.0.0", debug=True)

python-tutorials/youtube_down.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from pytube import YouTube
2+
3+
link = "https://www.youtube.com/watch?v=NM3HVHvFWRg"
4+
5+
try:
6+
yt = YouTube(link)
7+
except:
8+
print("Erro de conexao")
9+
10+
try:
11+
#fazendo download do video
12+
yt.streams.filter(progressive=True, file_extension="mp4").first().download()
13+
except:
14+
print("Erro ao fazer o download")
15+
print("D")

0 commit comments

Comments
 (0)