mirror of
https://github.com/believethehype/nostrdvm.git
synced 2025-03-18 05:41:51 +01:00
get rid of insta scrapper
This commit is contained in:
parent
4b0d59723e
commit
dd07472538
@ -3,7 +3,6 @@ from typing import Any
|
||||
from urllib.request import urlopen, Request
|
||||
|
||||
import requests
|
||||
import instaloader
|
||||
import json
|
||||
import yt_dlp
|
||||
import sys
|
||||
@ -119,34 +118,6 @@ def TiktokDownloadAll(linkList, path) -> str:
|
||||
exit(1)
|
||||
|
||||
|
||||
def InstagramDownload(url, name, path) -> str:
|
||||
obj = instaloader.Instaloader()
|
||||
post = instaloader.Post.from_shortcode(obj.context, url.split("/")[-2])
|
||||
photo_url = post.url
|
||||
video_url = post.video_url
|
||||
print(video_url)
|
||||
if video_url:
|
||||
response = requests.get(video_url)
|
||||
with open(path + "\\" + name + ".mp4", "wb") as f:
|
||||
f.write(response.content)
|
||||
return path + "\\" + name + ".mp4"
|
||||
elif photo_url:
|
||||
response = requests.get(photo_url)
|
||||
with open(path + "\\" + name + ".jpg", "wb") as f:
|
||||
f.write(response.content)
|
||||
return path + "\\" + name + ".jpg"
|
||||
|
||||
def InstagramDownloadAll(linklist, path) -> str:
|
||||
for i in linklist:
|
||||
try:
|
||||
print(str(linklist.index(i)))
|
||||
print(str(linklist[i]))
|
||||
result = InstagramDownload(i, str(linklist.index(i)), path)
|
||||
return result
|
||||
except Exception as err:
|
||||
print(err)
|
||||
exit(1)
|
||||
|
||||
def YTDownload(link, path, audio_only=True):
|
||||
|
||||
if audio_only:
|
||||
|
Loading…
x
Reference in New Issue
Block a user