l;k;klj
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -25,7 +25,7 @@ share/python-wheels/
|
|||||||
.installed.cfg
|
.installed.cfg
|
||||||
*.egg
|
*.egg
|
||||||
MANIFEST
|
MANIFEST
|
||||||
|
test_*
|
||||||
# PyInstaller
|
# PyInstaller
|
||||||
# Usually these files are written by a python script from a template
|
# Usually these files are written by a python script from a template
|
||||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||||
|
|||||||
19
debug_db.py
19
debug_db.py
@@ -1,19 +0,0 @@
|
|||||||
|
|
||||||
import sqlite3
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
db_path = Path("C:/Media Machina/.downlow_library.db")
|
|
||||||
|
|
||||||
if not db_path.exists():
|
|
||||||
print(f"DB not found at {db_path}")
|
|
||||||
else:
|
|
||||||
conn = sqlite3.connect(db_path)
|
|
||||||
cursor = conn.cursor()
|
|
||||||
|
|
||||||
print("Files in DB:")
|
|
||||||
cursor.execute("SELECT id, file_path FROM files")
|
|
||||||
for row in cursor.fetchall():
|
|
||||||
print(f"ID: {row[0]}, Path: {row[1]}")
|
|
||||||
|
|
||||||
conn.close()
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
import sys
|
|
||||||
sys.path.insert(0, '.')
|
|
||||||
from helper.file_storage import LocalStorageBackend
|
|
||||||
from config import get_local_storage_path
|
|
||||||
import json
|
|
||||||
|
|
||||||
config = json.load(open('config.json'))
|
|
||||||
# Get the location string properly
|
|
||||||
location = get_local_storage_path(config)
|
|
||||||
if isinstance(location, dict):
|
|
||||||
location = location.get('path') or str(location)
|
|
||||||
|
|
||||||
backend = LocalStorageBackend(config)
|
|
||||||
|
|
||||||
# Test searches
|
|
||||||
for query in ['sie*', 'sie', '*']:
|
|
||||||
print(f"\n=== Searching for: {query} ===")
|
|
||||||
results = backend.search(query, location=str(location), limit=5)
|
|
||||||
print(f"Found {len(results)} results")
|
|
||||||
for r in results:
|
|
||||||
print(f" - {r.get('title')} ({r.get('ext')}) @ {r.get('path')}")
|
|
||||||
|
|
||||||
44
test_ssl.py
44
test_ssl.py
@@ -1,44 +0,0 @@
|
|||||||
import httpx
|
|
||||||
import ssl
|
|
||||||
|
|
||||||
def test_libgen_ssl():
|
|
||||||
url = "https://libgen.li/series.php?id=577851"
|
|
||||||
headers = {
|
|
||||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
|
|
||||||
}
|
|
||||||
|
|
||||||
print(f"Testing connection to {url} with httpx...")
|
|
||||||
try:
|
|
||||||
with httpx.Client(verify=True, headers=headers, timeout=30.0) as client:
|
|
||||||
resp = client.get(url)
|
|
||||||
print(f"Status: {resp.status_code}")
|
|
||||||
print(f"Content length: {len(resp.content)}")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error with default settings: {e}")
|
|
||||||
|
|
||||||
print("\nTesting with http2=True...")
|
|
||||||
try:
|
|
||||||
with httpx.Client(verify=True, headers=headers, timeout=30.0, http2=True) as client:
|
|
||||||
resp = client.get(url)
|
|
||||||
print(f"Status: {resp.status_code}")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error with http2=True: {e}")
|
|
||||||
|
|
||||||
print("\nTesting with verify=False...")
|
|
||||||
try:
|
|
||||||
with httpx.Client(verify=False, headers=headers, timeout=30.0) as client:
|
|
||||||
resp = client.get(url)
|
|
||||||
print(f"Status: {resp.status_code}")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error with verify=False: {e}")
|
|
||||||
|
|
||||||
import requests
|
|
||||||
print("\nTesting with requests (HTTP/1.1)...")
|
|
||||||
try:
|
|
||||||
resp = requests.get(url, headers=headers, timeout=30.0)
|
|
||||||
print(f"Status: {resp.status_code}")
|
|
||||||
except Exception as e:
|
|
||||||
print(f"Error with requests: {e}")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
test_libgen_ssl()
|
|
||||||
Reference in New Issue
Block a user