Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dc5542bb2 | ||
|
|
6ec47572de | ||
|
|
a769502237 | ||
|
|
928165467c |
@@ -10,12 +10,15 @@ A program to aid in queuing downloads from Vimm.net
|
|||||||
### Shared
|
### Shared
|
||||||
|
|
||||||
- [Google Chrome](https://www.google.com/chrome/)
|
- [Google Chrome](https://www.google.com/chrome/)
|
||||||
- [Chromedriver](https://googlechromelabs.github.io/chrome-for-testing/)
|
- ~~[Chromedriver](https://googlechromelabs.github.io/chrome-for-testing/)~~
|
||||||
|
|
||||||
### Source
|
### Source
|
||||||
|
|
||||||
- Python 3.11 (others might work)
|
- Python 3.11 (others might work)
|
||||||
- Selenium `pip install selenium`
|
- Selenium `pip install selenium`
|
||||||
|
- Results `pip install results`
|
||||||
|
- Pathlib ` pip install pathlib`
|
||||||
|
- Pathvalidate `pip install pathvalidate`
|
||||||
|
|
||||||
## Programs
|
## Programs
|
||||||
|
|
||||||
@@ -68,6 +71,7 @@ V-dlp will parse a file and attempt to download each one at a time.
|
|||||||
- [X] Show number of URLs
|
- [X] Show number of URLs
|
||||||
- [X] Show download name/size
|
- [X] Show download name/size
|
||||||
- [X] Add headless option
|
- [X] Add headless option
|
||||||
|
- [X] Remove dependency of Chrome Driver
|
||||||
- [X] Show failed downloads
|
- [X] Show failed downloads
|
||||||
- [X] Remove duplicate URLs
|
- [X] Remove duplicate URLs
|
||||||
- [X] Get all links (#, A-Z)
|
- [X] Get all links (#, A-Z)
|
||||||
@@ -78,7 +82,6 @@ V-dlp will parse a file and attempt to download each one at a time.
|
|||||||
- [ ] Proper error handling
|
- [ ] Proper error handling
|
||||||
- [ ] Download manuals
|
- [ ] Download manuals
|
||||||
- [ ] Email upon completion
|
- [ ] Email upon completion
|
||||||
- [ ] Remove dependency on external start of Chrome Driver
|
|
||||||
- [ ] Click on ads
|
- [ ] Click on ads
|
||||||
- [ ] OS agnostic (heavily Windows based as they need the most hand holding)
|
- [ ] OS agnostic (heavily Windows based as they need the most hand holding)
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import glob
|
|||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
from pathvalidate import sanitize_filename
|
||||||
import random
|
import random
|
||||||
import requests
|
import requests
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
@@ -16,7 +17,7 @@ from selenium.webdriver.support import expected_conditions as EC
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
__version__ = "2026.3.25.0"
|
__version__ = "2026.3.26.0"
|
||||||
|
|
||||||
# Helper for logging
|
# Helper for logging
|
||||||
def setup_logging(mode="syslog", logfile=None):
|
def setup_logging(mode="syslog", logfile=None):
|
||||||
@@ -122,11 +123,7 @@ def main():
|
|||||||
chrome_options.add_experimental_option("prefs", prefs)
|
chrome_options.add_experimental_option("prefs", prefs)
|
||||||
|
|
||||||
driver = webdriver.Chrome(options=chrome_options)
|
driver = webdriver.Chrome(options=chrome_options)
|
||||||
#driver = webdriver.Chrome(service=Service(r"C:\Tools\Standalone\chromedriver.exe"), options=chrome_options)
|
|
||||||
#driver = webdriver.Remote(
|
|
||||||
# command_executor=f"http://127.0.0.1:{chrome_port}",
|
|
||||||
# options=chrome_options
|
|
||||||
#)
|
|
||||||
if headless == True:
|
if headless == True:
|
||||||
# Chrome sometimes blocks downloads in headless mode
|
# Chrome sometimes blocks downloads in headless mode
|
||||||
driver.execute_cdp_cmd(
|
driver.execute_cdp_cmd(
|
||||||
@@ -203,12 +200,14 @@ def main():
|
|||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
fext = 'avif'
|
fext = 'avif'
|
||||||
|
ftitle = sanitize_filename(title)
|
||||||
if iform == 2:
|
if iform == 2:
|
||||||
fext = 'webp'
|
fext = 'webp'
|
||||||
save_path = os.path.join(download_dir, f"{title}.{fext}")
|
save_path = os.path.join(f"{download_dir}", f"{ftitle}.{fext}")
|
||||||
with open(save_path, 'wb') as file:
|
with open(save_path, 'wb') as file:
|
||||||
for chunk in response.iter_content(1024):
|
for chunk in response.iter_content(1024):
|
||||||
file.write(chunk)
|
file.write(chunk)
|
||||||
|
time.sleep(1)
|
||||||
else:
|
else:
|
||||||
logging.warning(f"Could not download box image: {response.status_code} - {response.reason}")
|
logging.warning(f"Could not download box image: {response.status_code} - {response.reason}")
|
||||||
pass
|
pass
|
||||||
@@ -237,6 +236,7 @@ def main():
|
|||||||
logging.warning("No large box image found.")
|
logging.warning("No large box image found.")
|
||||||
actions = ActionChains(driver)
|
actions = ActionChains(driver)
|
||||||
actions.move_to_element_with_offset(body_element, random.randint(1, 100), random.randint(1, 100)).click().perform()
|
actions.move_to_element_with_offset(body_element, random.randint(1, 100), random.randint(1, 100)).click().perform()
|
||||||
|
time.sleep(1)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warning(f"No large box image found! {e}")
|
logging.warning(f"No large box image found! {e}")
|
||||||
except:
|
except:
|
||||||
|
|||||||
+4
-4
@@ -7,8 +7,8 @@ VSVersionInfo(
|
|||||||
ffi=FixedFileInfo(
|
ffi=FixedFileInfo(
|
||||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||||
# Set not needed items to zero 0. Must always contain 4 elements.
|
# Set not needed items to zero 0. Must always contain 4 elements.
|
||||||
filevers=(2026,3,25,0),
|
filevers=(2026,3,26,0),
|
||||||
prodvers=(2026,3,25,0),
|
prodvers=(2026,3,26,0),
|
||||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||||
mask=0x3f,
|
mask=0x3f,
|
||||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
# Contains a bitmask that specifies the Boolean attributes of the file.
|
||||||
@@ -32,12 +32,12 @@ VSVersionInfo(
|
|||||||
u'040904B0',
|
u'040904B0',
|
||||||
[StringStruct(u'CompanyName', u''),
|
[StringStruct(u'CompanyName', u''),
|
||||||
StringStruct(u'FileDescription', u'V-dlp: download a list of Vimm URLs'),
|
StringStruct(u'FileDescription', u'V-dlp: download a list of Vimm URLs'),
|
||||||
StringStruct(u'FileVersion', u'2026.3.25.0'),
|
StringStruct(u'FileVersion', u'2026.3.26.0'),
|
||||||
StringStruct(u'InternalName', u'V-dlp'),
|
StringStruct(u'InternalName', u'V-dlp'),
|
||||||
StringStruct(u'LegalCopyright', u'© iamdoubz'),
|
StringStruct(u'LegalCopyright', u'© iamdoubz'),
|
||||||
StringStruct(u'OriginalFilename', u'V-dlp.exe'),
|
StringStruct(u'OriginalFilename', u'V-dlp.exe'),
|
||||||
StringStruct(u'ProductName', u'V-dlp'),
|
StringStruct(u'ProductName', u'V-dlp'),
|
||||||
StringStruct(u'ProductVersion', u'2026.3.25.0')])
|
StringStruct(u'ProductVersion', u'2026.3.26.0')])
|
||||||
]),
|
]),
|
||||||
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
|
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ VSVersionInfo(
|
|||||||
ffi=FixedFileInfo(
|
ffi=FixedFileInfo(
|
||||||
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
# filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4)
|
||||||
# Set not needed items to zero 0. Must always contain 4 elements.
|
# Set not needed items to zero 0. Must always contain 4 elements.
|
||||||
filevers=(2026,3,25,0),
|
filevers=(2026,3,26,0),
|
||||||
prodvers=(2026,3,25,0),
|
prodvers=(2026,3,26,0),
|
||||||
# Contains a bitmask that specifies the valid bits 'flags'r
|
# Contains a bitmask that specifies the valid bits 'flags'r
|
||||||
mask=0x3f,
|
mask=0x3f,
|
||||||
# Contains a bitmask that specifies the Boolean attributes of the file.
|
# Contains a bitmask that specifies the Boolean attributes of the file.
|
||||||
@@ -31,13 +31,13 @@ VSVersionInfo(
|
|||||||
StringTable(
|
StringTable(
|
||||||
u'040904B0',
|
u'040904B0',
|
||||||
[StringStruct(u'CompanyName', u''),
|
[StringStruct(u'CompanyName', u''),
|
||||||
StringStruct(u'FileDescription', u'V-dlp UG: create a list of Vimm URLs'),
|
StringStruct(u'FileDescription', u'V-dlpUG: create a list of Vimm URLs'),
|
||||||
StringStruct(u'FileVersion', u'2026.3.25.0'),
|
StringStruct(u'FileVersion', u'2026.3.26.0'),
|
||||||
StringStruct(u'InternalName', u'V-dlpUG'),
|
StringStruct(u'InternalName', u'V-dlpUG'),
|
||||||
StringStruct(u'LegalCopyright', u'© iamdoubz'),
|
StringStruct(u'LegalCopyright', u'© iamdoubz'),
|
||||||
StringStruct(u'OriginalFilename', u'V-dlpUG.exe'),
|
StringStruct(u'OriginalFilename', u'V-dlpUG.exe'),
|
||||||
StringStruct(u'ProductName', u'V-dlpUG'),
|
StringStruct(u'ProductName', u'V-dlpUG'),
|
||||||
StringStruct(u'ProductVersion', u'2026.3.25.0')])
|
StringStruct(u'ProductVersion', u'2026.3.26.0')])
|
||||||
]),
|
]),
|
||||||
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
|
VarFileInfo([VarStruct(u'Translation', [1033, 1200])])
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from selenium.webdriver.chrome.options import Options
|
|||||||
import string
|
import string
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
__version__ = "2026.3.25.0"
|
__version__ = "2026.3.26.0"
|
||||||
|
|
||||||
# Helper for logging
|
# Helper for logging
|
||||||
def setup_logging(mode="syslog", logfile=None):
|
def setup_logging(mode="syslog", logfile=None):
|
||||||
@@ -91,10 +91,7 @@ def main():
|
|||||||
chrome_options.add_argument("--no-sandbox")
|
chrome_options.add_argument("--no-sandbox")
|
||||||
chrome_options.add_argument("--disable-dev-shm-usage")
|
chrome_options.add_argument("--disable-dev-shm-usage")
|
||||||
|
|
||||||
driver = webdriver.Remote(
|
driver = webdriver.Chrome(options=chrome_options)
|
||||||
command_executor=f"http://127.0.0.1:{chrome_port}",
|
|
||||||
options=chrome_options
|
|
||||||
)
|
|
||||||
|
|
||||||
# Function to read platform/letter and write links to file
|
# Function to read platform/letter and write links to file
|
||||||
def get_links(pf, lets):
|
def get_links(pf, lets):
|
||||||
|
|||||||
Reference in New Issue
Block a user