Skip item from downloads when "product_name" contains "productVersion"
This commit is contained in:
+8
-2
@@ -43,7 +43,7 @@ def login_with_selenium(driver, email, password):
|
|||||||
Returns:
|
Returns:
|
||||||
True if login successful, False otherwise
|
True if login successful, False otherwise
|
||||||
"""
|
"""
|
||||||
login_url = "https://shop.2000ad.com/account/sign-in"
|
login_url = "https://shop.2000ad.com/login"
|
||||||
|
|
||||||
print("🔐 Navigating to login page...")
|
print("🔐 Navigating to login page...")
|
||||||
driver.get(login_url)
|
driver.get(login_url)
|
||||||
@@ -217,6 +217,12 @@ def download_cbz_files(email, password, output_dir='downloads', headless=True):
|
|||||||
# Get product name for better logging
|
# Get product name for better logging
|
||||||
product_name = product.get('data-name', 'Unknown')
|
product_name = product.get('data-name', 'Unknown')
|
||||||
|
|
||||||
|
# Skip products with placeholder/error text
|
||||||
|
if '[Pen_-productVersion' in product_name or 'productVersion' in product_name:
|
||||||
|
print(f"⏭️ Skipping (placeholder/error in name): {product_name}")
|
||||||
|
skipped += 1
|
||||||
|
continue
|
||||||
|
|
||||||
# Get publication date
|
# Get publication date
|
||||||
release_date = product.get('data-released', '')
|
release_date = product.get('data-released', '')
|
||||||
date_str = ''
|
date_str = ''
|
||||||
@@ -330,4 +336,4 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# Run the download
|
# Run the download
|
||||||
# Set headless=False if you want to see the browser window
|
# Set headless=False if you want to see the browser window
|
||||||
download_cbz_files(email, password, output_dir=output_dir, headless=True)
|
download_cbz_files(email, password, output_dir=output_dir, headless=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user