mirror of
https://github.com/bellingcat/tiktok-hashtag-analysis.git
synced 2026-06-08 03:18:31 +03:00
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:
@@ -1,3 +1 @@
|
||||
__version__ = "2.0.0"
|
||||
|
||||
from .base import TikTokDownloader
|
||||
|
||||
@@ -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."""
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
11
tiktok_hashtag_analysis/version.py
Normal file
11
tiktok_hashtag_analysis/version.py
Normal 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)
|
||||
Reference in New Issue
Block a user