diff --git a/config.py b/config.py index aa6981a..1169eae 100644 --- a/config.py +++ b/config.py @@ -1,5 +1,5 @@ -import mysql.connector from BunnyCDN.Storage import Storage +import mysql.connector username = "doadmin" password = "AVNS_2qeFJuiGRpBQXkJjlA6" diff --git a/dedupe_scripts/dedupe_phash.py b/dedupe_scripts/dedupe_phash.py index f132e68..9efab70 100644 --- a/dedupe_scripts/dedupe_phash.py +++ b/dedupe_scripts/dedupe_phash.py @@ -1,8 +1,8 @@ -import os -import config -import imagehash -from PIL import Image from funcs import get_files +from PIL import Image +import imagehash +import config +import os def generate_image_phash(filepath, hash_size=8): try: diff --git a/dedupe_scripts/dupecleaner_phash.py b/dedupe_scripts/dupecleaner_phash.py index 3018dcd..85badab 100644 --- a/dedupe_scripts/dupecleaner_phash.py +++ b/dedupe_scripts/dupecleaner_phash.py @@ -1,6 +1,6 @@ -import os from funcs import generate_phash # Assuming this function computes the pHash and returns a string import imagehash +import os def get_files(directory): # Recursively get all files in the directory diff --git a/dedupe_scripts/find_by_phash.py b/dedupe_scripts/find_by_phash.py index 627a54c..a08977c 100644 --- a/dedupe_scripts/find_by_phash.py +++ b/dedupe_scripts/find_by_phash.py @@ -1,5 +1,3 @@ -import os -import funcs import config # Function to find the closest perceptual hash (phash) match diff --git a/dedupe_scripts/find_duplicates_by_phash.py b/dedupe_scripts/find_duplicates_by_phash.py index 83326af..d768be0 100644 --- a/dedupe_scripts/find_duplicates_by_phash.py +++ b/dedupe_scripts/find_duplicates_by_phash.py @@ -1,8 +1,8 @@ -import os -import config -import imagehash -from PIL import Image from funcs import get_files # Assuming this is defined elsewhere +from PIL import Image +import imagehash +import config +import os def generate_image_phash(filepath, hash_size=8): try: diff --git a/dedupe_scripts/find_duplicates_by_phash_videos.py b/dedupe_scripts/find_duplicates_by_phash_videos.py index 23453e2..5ade342 100644 --- a/dedupe_scripts/find_duplicates_by_phash_videos.py +++ b/dedupe_scripts/find_duplicates_by_phash_videos.py @@ -1,8 +1,8 @@ -import os +from PIL import Image +import imagehash import config import cv2 -import imagehash -from PIL import Image +import os def generate_thumbnail_phash(filepath, hash_size=8): # Set hash_size to 8 cap = cv2.VideoCapture(filepath) diff --git a/dedupe_scripts/image_dupe_cleaner.py b/dedupe_scripts/image_dupe_cleaner.py index b76966c..24efc1d 100644 --- a/dedupe_scripts/image_dupe_cleaner.py +++ b/dedupe_scripts/image_dupe_cleaner.py @@ -1,5 +1,5 @@ -import os from funcs import generate_phash +import os def find_duplicates(source_dir, target_dir, extensions, max_distance): """Remove duplicates in target_dir that are found in source_dir based on Hamming distance.""" diff --git a/dedupe_scripts/snappy_duplicates.py b/dedupe_scripts/snappy_duplicates.py index 0b7138c..e95ff50 100644 --- a/dedupe_scripts/snappy_duplicates.py +++ b/dedupe_scripts/snappy_duplicates.py @@ -1,10 +1,13 @@ -import os, config, funcs, cv2, imagehash from PIL import Image +import imagehash +import config +import funcs +import cv2 +import os directory = "old_snapchats" duplicate_dir = 'dupelicate_snaps' - def generate_video_phash(filepath): try: cap = cv2.VideoCapture(filepath) diff --git a/find_static_videos.py b/find_static_videos.py index eae0e77..86a2f5e 100644 --- a/find_static_videos.py +++ b/find_static_videos.py @@ -1,7 +1,7 @@ -import cv2, os -import imagehash -from PIL import Image from funcs import get_files +from PIL import Image +import imagehash +import cv2 def is_static_video_phash_optimized(video_path, frame_sample_rate=30, hash_size=16, hamming_threshold=1): """ diff --git a/funcs.py b/funcs.py index fb63241..1537e6c 100644 --- a/funcs.py +++ b/funcs.py @@ -1,8 +1,11 @@ -from moviepy.editor import VideoFileClip -import os, cv2, hashlib, requests -from PIL import Image -import numpy as np +import os +import cv2 +import hashlib +import requests import imagehash +import numpy as np +from PIL import Image +from moviepy.editor import VideoFileClip headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"} proxies={"http": "http://yehyuxsl-rotate:4tl5bvrwkz5e@p.webshare.io:80/","https": "http://yehyuxsl-rotate:4tl5bvrwkz5e@p.webshare.io:80/"} diff --git a/old/snappy.py b/old/snappy.py index d70186c..fa036e8 100644 --- a/old/snappy.py +++ b/old/snappy.py @@ -1,6 +1,9 @@ -from datetime import datetime -import os, requests, config, json from snapchat import get_data, get_stories, get_highlight_stories +from datetime import datetime +import requests +import config +import json +import os """ media_url_filename = url.split('/')[-1].split('?')[0] diff --git a/snapchat.py b/snapchat.py index c1167e0..487f2f7 100644 --- a/snapchat.py +++ b/snapchat.py @@ -1,6 +1,7 @@ -import requests, json -from bs4 import BeautifulSoup from concurrent.futures import ThreadPoolExecutor, as_completed +from bs4 import BeautifulSoup +import requests +import json headers = {"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36"} diff --git a/snappy_master.py b/snappy_master.py index 0977274..fa57412 100644 --- a/snappy_master.py +++ b/snappy_master.py @@ -1,7 +1,12 @@ -from uuid import uuid4 -from datetime import datetime -import os, requests, config, json, funcs, cv2, re from snapchat import get_stories, get_highlight_stories, get_all_users_data +from datetime import datetime +from uuid import uuid4 +import requests +import config +import funcs +import json +import cv2 +import os directory = "snapchat" data_directory = "data" diff --git a/storysave_api.py b/storysave_api.py index dd36886..82c49dc 100644 --- a/storysave_api.py +++ b/storysave_api.py @@ -1,5 +1,6 @@ -import json, requests from bs4 import BeautifulSoup +import requests +import json def findPost(filePath = 'test.json'): params = {'av': '17841401225494803','__a': '1','__req': '1','__hs': '19906.HYP:instagram_web_pkg.2.1..0.1','dpr': '1','__ccg': 'UNKNOWN','__rev': '1014609539','__s': 'guk60j:651i2v:pmhu0r','__hsi': '7386834689999716220','__dyn': '7xe5WwlEnwn8K2Wmm1twpUnwgU7S6EdF8aUco38w5ux609vCwjE1xoswaq0yE6u0nS4oaEd86a3a1YwBgao1aU2swbOU2zxe2GewGw9a362W2K0zEnwhEe82mwww4cwJCwLyES1TwTwFwIwbS1LwTwKG1pg2Xwr86C1mwrd6goK3ibxKi2K7ErwYCz8rwHw','__csr': 'igAzIj5OgR5YBHdRtivbkyFv-zJIZE_ykzfahdAydeHCHAAAqyk4pqBgDzeV4-qlbBF29UlCxFpVokDwAyosyV9KWUmx6iu58WqdwSDCDAFwHxi3C00lWy2FG4k583NxW8yFE0bUyxd06lxO5C2a8yFm2u290ejg1JU2Gw2rQ061U','__comet_req': '7','fb_dtsg': 'NAcPDfX2XufdLkctek6zNxz3DWxPW4t-cJzz39QtOQ5KS-_Rq3erT4A:17843708194158284:1719013044','jazoest': '26262','lsd': 'D0zmaX16yIQu_GwDXKTbMc','__spin_r': '1014609539','__spin_b': 'trunk','__spin_t': '1719881474','__jssesw': '1','fb_api_caller_class': 'RelayModern','fb_api_req_friendly_name': 'PolarisProfilePageContentDirectQuery', 'variables': '{"id":"57771591453","render_surface":"PROFILE"}','server_timestamps': 'true','doc_id': '7663723823674585'} diff --git a/storysave_dump.py b/storysave_dump.py index 149c049..37f20d2 100644 --- a/storysave_dump.py +++ b/storysave_dump.py @@ -1,6 +1,9 @@ from datetime import datetime -import os, config, funcs, cv2 from uuid import uuid4 +import funcs +import config +import cv2 +import os directory = 'storysaver' diff --git a/storysave_dump_media.py b/storysave_dump_media.py index 1bf6427..fdf9321 100644 --- a/storysave_dump_media.py +++ b/storysave_dump_media.py @@ -1,5 +1,8 @@ from datetime import datetime -import os, config, funcs, cv2 +import config +import funcs +import cv2 +import os directory = 'storysaver' diff --git a/storysave_dump_tiktok.py b/storysave_dump_tiktok.py index f4ddf10..255d0c7 100644 --- a/storysave_dump_tiktok.py +++ b/storysave_dump_tiktok.py @@ -1,6 +1,9 @@ from datetime import datetime -import os, config, funcs, cv2 from uuid import uuid4 +import funcs +import config +import cv2 +import os directory = 'processed_tiktoks' diff --git a/storysave_dump_tiktok_process.py b/storysave_dump_tiktok_process.py index 59452b1..867379e 100644 --- a/storysave_dump_tiktok_process.py +++ b/storysave_dump_tiktok_process.py @@ -1,6 +1,6 @@ -import os from uuid import uuid4 import uuid +import os def is_valid_uuid(uuid_to_test, version=4): try: diff --git a/storysave_dump_unknown.py b/storysave_dump_unknown.py index 5d0031e..5e0a3e3 100644 --- a/storysave_dump_unknown.py +++ b/storysave_dump_unknown.py @@ -1,6 +1,9 @@ from datetime import datetime -import os, config, funcs, cv2 from uuid import uuid4 +import funcs +import config +import cv2 +import os directory = 'ready_for_upload/instagram' diff --git a/storysave_scanner.py b/storysave_scanner.py index b62f854..f5ef9c5 100644 --- a/storysave_scanner.py +++ b/storysave_scanner.py @@ -1,6 +1,8 @@ -import os, shutil, time -from watchdog.observers import Observer from watchdog.events import FileSystemEventHandler +from watchdog.observers import Observer +import shutil +import time +import os class DownloadHandler(FileSystemEventHandler): def process_file(self, file_path): diff --git a/storysaver.py b/storysaver.py index e970fe2..0ec9ba8 100644 --- a/storysaver.py +++ b/storysaver.py @@ -1,11 +1,16 @@ -import cv2, os, json, config, time, hashlib, requests - from concurrent.futures import ThreadPoolExecutor from moviepy.editor import VideoFileClip from cryptography.fernet import Fernet from BunnyCDN.Storage import Storage from instagrapi import Client from PIL import Image +import requests +import hashlib +import config +import json +import time +import cv2 +import os headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36"} proxies={"http": "http://yehyuxsl-rotate:4tl5bvrwkz5e@p.webshare.io:80/","https": "http://yehyuxsl-rotate:4tl5bvrwkz5e@p.webshare.io:80/"} diff --git a/storysaver_new.py b/storysaver_new.py index 7947e32..20f1124 100644 --- a/storysaver_new.py +++ b/storysaver_new.py @@ -3,8 +3,9 @@ from BunnyCDN.Storage import Storage from instagrapi import Client from uuid import uuid4 from PIL import Image -import os, config, funcs - +import config +import funcs +import os def insert_highlight_items(media_ids, highlight_id, title, user_id): try: