Skip to content

Commit 866ba88

Browse files
committed
Twilio and youtube multithread downloader
Created a twilio app and youtube video downloader. Capable of making a call and downloading videos with multithreading
1 parent 404684b commit 866ba88

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

Twilio.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Download the helper library from https://www.twilio.com/docs/python/install
2+
import os
3+
from twilio.rest import Client
4+
5+
account_sid = 'enter-your-sid'
6+
auth_token = 'enter-your-token'
7+
client = Client(account_sid, auth_token)
8+
9+
call = client.calls.create(
10+
twiml='<Response><Play loop="10">https://demo.twilio.com/docs/classic.mp3</Play></Response>',
11+
to='',
12+
from_=''
13+
)
14+
15+
print(call.sid)
+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# parth bansal
2+
# https://github.com/parthbansal05
3+
from pytube import YouTube
4+
import threading
5+
from tkinter import Tk
6+
import time
7+
8+
update = 0
9+
stop = 0
10+
link = ""
11+
old_cpy_txt = ""
12+
13+
14+
def downloader(link):
15+
try:
16+
vid_obj = YouTube(link)
17+
print("downloading video "+vid_obj.title)
18+
vid_obj = vid_obj.streams.get_highest_resolution()
19+
vid_obj.download()
20+
print("downloaded video "+vid_obj.title)
21+
except:
22+
pass
23+
# print(link)
24+
25+
26+
while stop == 0:
27+
28+
if update == 1:
29+
update = 0
30+
down_ld = threading.Thread(target=downloader, args=(link,)).start()
31+
cpy_txt = Tk().clipboard_get()
32+
if cpy_txt!="testing":
33+
if old_cpy_txt != cpy_txt:
34+
link = cpy_txt
35+
update = 1
36+
old_cpy_txt = cpy_txt
37+
38+
time.sleep(1)

0 commit comments

Comments
 (0)