preparing for publishing (removed pipenv commands from workflow, added Contributing section on README, added functionality to pin dependency versions with requirements.txt)

This commit is contained in:
Tristan Lee
2023-09-06 09:51:31 -05:00
parent 8c32a3cf16
commit 10821e30f2
9 changed files with 74 additions and 11 deletions

View File

@@ -1,3 +1 @@
__version__ = "2.0.0"
from .base import TikTokDownloader

View File

@@ -15,6 +15,7 @@ class Authorization:
self.config_file = Path.home() / ".tiktok"
self.section = "TikTok"
self.ms_token = None
def get_token(self) -> str:
"""Load the "msToken" cookie taken from TikTok, which the scraper requires."""

View File

@@ -192,7 +192,10 @@ class TikTokDownloader:
# Download video files for all video posts
if len(urls_to_download) > 0:
logging.info(f"Downloading media for hashtag {hashtag}")
ydl_opts = {"outtmpl": os.path.join(video_dir, "%(id)s.%(ext)s"), "ignore_errors": True}
ydl_opts = {
"outtmpl": os.path.join(video_dir, "%(id)s.%(ext)s"),
"ignore_errors": True,
}
with yt_dlp.YoutubeDL(ydl_opts) as ydl:
ydl.download(urls_to_download)

View File

@@ -0,0 +1,11 @@
_MAJOR = "2"
_MINOR = "0"
# On main and in a nightly release the patch should be one ahead of the last
# released build.
_PATCH = "0"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = ""
VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR)
VERSION = "{0}.{1}.{2}{3}".format(_MAJOR, _MINOR, _PATCH, _SUFFIX)