Threads uygulamadaki video/resim indirmek için bir API ihtiyacım var
codecanyon dan satın aldığım Threads video indirme uygulaması , yazılımcının kendi website API'sini kullanıyor, buda ara sıra sorunlar yaşatabiliyor.
örnek site threads 'daki video'ları indirme sağlıyor aynı şekilde olacaktır. ( işlevsel, ) script/tema değil
https://threadsmate.com/ örnek site;
https://www.threads.net/t/CuzTB5nIpKw/?igshid=NTc4MTIwNjQ2YQ== ( Threads deki herhangi bir video URL'si )
aşağıdaki kod herhangi bir siteye istek atıyor, ve yapılan API url uzantısı aşağıdaki kod ekleyeceğiz.
FİYAT PM
import time
import requests as rq
from urllib.request import Request, urlopen
def get_download(link):
req = 'http://domain.com'
data = {'link': link}
resp = rq.get(req, params=data)
aa = resp.json()
tthumbn = aa['thumbnail']
turl = aa['url']
return tthumbn, turl
def download(url, directory, app_name, download_type):
req = Request(url, headers={"User-Agent": "Mozilla/5.0"})
timestr = time.strftime("%Y%m%d%H%M%S")
if 'videoDownload' in str(download_type):
video_to_download = urlopen(req).read()
with open(directory+app_name+"/igsaver_"+timestr+".mp4", 'wb') as video_stream:
video_stream.write(video_to_download)
elif 'photoDownload' in str(download_type):
photo_to_download = urlopen(req).read()
with open(directory+app_name+"/igsaver_"+timestr+".jpg", 'wb') as photo_stream:
photo_stream.write(photo_to_download)
elif 'audioDownload' in str(download_type):
audio_to_download = urlopen(req).read()
with open(directory+app_name+"/igsaver_"+timestr+".mp3", 'wb') as audio_stream:
audio_stream.write(audio_to_download)