25 lines
808 B
Python
25 lines
808 B
Python
import sys
|
|
from pathlib import Path
|
|
|
|
# Add parent workspace directory to path to import generic_downloader
|
|
sys.path.append(str(Path(__file__).resolve().parents[1]))
|
|
import generic_downloader
|
|
|
|
def is_video_link(url):
|
|
# Match ThisVid paths like: https://thisvid.com/video/12345/
|
|
return "/video/" in url
|
|
|
|
if __name__ == "__main__":
|
|
uploader_eval = """() => {
|
|
const el = document.querySelector('a[href*="/members/"], a[href*="/profile/"], .username');
|
|
return el ? el.innerText.trim() : 'unknown';
|
|
}"""
|
|
|
|
generic_downloader.run(
|
|
site_name="ThisVid",
|
|
is_video_link_fn=is_video_link,
|
|
next_page_selector="a:has-text('Next'), .next, a.pagination-next",
|
|
video_selector="video",
|
|
uploader_eval_js=uploader_eval
|
|
)
|