From dd07472538865eca5fc0a90a19f78aa60a5be4ba Mon Sep 17 00:00:00 2001 From: Believethehype <1097224+believethehype@users.noreply.github.com> Date: Fri, 21 Jun 2024 16:12:30 +0200 Subject: [PATCH] get rid of insta scrapper --- nostr_dvm/utils/scrapper/media_scrapper.py | 29 ---------------------- setup.py | 1 - 2 files changed, 30 deletions(-) diff --git a/nostr_dvm/utils/scrapper/media_scrapper.py b/nostr_dvm/utils/scrapper/media_scrapper.py index 6231bd3..1f9a8f5 100644 --- a/nostr_dvm/utils/scrapper/media_scrapper.py +++ b/nostr_dvm/utils/scrapper/media_scrapper.py @@ -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: diff --git a/setup.py b/setup.py index fc9e734..4a01064 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,6 @@ setup( "PyUpload==0.1.4", "requests==2.32.3", "moviepy==2.0.0.dev2", - "instaloader==4.11", "zipp==3.17.0", "urllib3==2.2.1", "networkx==3.3",