separate cli and gui application in own python packages. provide database schema as python package.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import requests
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
|
||||
class VideoLink:
|
||||
|
||||
def __init__(self, url: str, log):
|
||||
self.url = url
|
||||
self.title = None
|
||||
self.log = log
|
||||
|
||||
def get_title(self):
|
||||
try:
|
||||
r = requests.get(self.url)
|
||||
soup = BeautifulSoup(r.content, "html.parser")
|
||||
title = soup.title.string
|
||||
except:
|
||||
self.log.info("Sorry, could not retrieve title")
|
||||
|
||||
def download(self, download_dir=None):
|
||||
self.log.info(f"download {self.url} to {download_dir}")
|
||||
Reference in New Issue
Block a user