separate cli and gui application in own python packages. provide database schema as python package.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
# Kontor Video
|
||||
|
||||
This project provides helper methods to handle video links, like Youtube or ZDF Mediathek.
|
||||
@@ -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}")
|
||||
@@ -0,0 +1,5 @@
|
||||
home = /usr/bin
|
||||
include-system-site-packages = false
|
||||
version = 3.11.2
|
||||
executable = /usr/bin/python3.11
|
||||
command = /usr/bin/python -m venv /home/tpeetz/projects/kontor/python/kontor-video
|
||||
@@ -0,0 +1,2 @@
|
||||
beautifulsoup4
|
||||
requests
|
||||
@@ -0,0 +1,23 @@
|
||||
from setuptools import setup, find_packages
|
||||
import pathlib
|
||||
|
||||
here = pathlib.Path(__file__).parent.resolve()
|
||||
|
||||
long_description = ( here / "README.md").read_text(encoding="utf-8")
|
||||
|
||||
setup(
|
||||
name='kontor_video',
|
||||
version='0.1.0',
|
||||
description='Helper methods to download videos',
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
author='Thomas Peetz',
|
||||
classifiers=[
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3.11",
|
||||
],
|
||||
install_requires=["beautifulsoup4"],
|
||||
packages=find_packages(),
|
||||
)
|
||||
Reference in New Issue
Block a user