PornHub-downloader-python icon indicating copy to clipboard operation
PornHub-downloader-python copied to clipboard

Deduplication of URLs does not work when adding same URL.

Open pashaka opened this issue 3 years ago • 1 comments

Adding URL calls add_item function, which checks new URL vs item_name, but not vs url in the database.

pashaka avatar Aug 13 '21 19:08 pashaka

Don't know how to make pull requests. But here is the fix:

--- a/functions.py
+++ b/functions.py
@@ -274,7 +274,7 @@ def add_item(name_check):
     conn = create_connection(database)
     c = conn.cursor()
     try:
-        c.execute("SELECT count(*) FROM ph_items WHERE url_name = ?", (item_name,))
+        c.execute("SELECT count(*) FROM ph_items WHERE url_name = ? and type = ? ", (item_url_name,item_type))

pashaka avatar Aug 13 '21 19:08 pashaka