diff --git a/Dockerfile b/Dockerfile index 7c5f7b1..941578a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN wget -q -O "/app/ytct.py" https://raw.githubusercontent.com/HoloArchivists/y RUN apt-get purge git -y && apt-get autopurge -y #Apply chat_downloader patch -#RUN sed -i "s/socs.value.startswith('CAA')/str(socs).startswith('CAA')/g" /usr/local/lib/python*/site-packages/chat_downloader/sites/youtube.py +RUN sed -i "s/socs.value.startswith('CAA')/str(socs).startswith('CAA')/g" /usr/local/lib/python*/site-packages/chat_downloader/sites/youtube.py #Apply patch to yt-dlp youtube extractor to make it work with yta-raw RUN sed -i '/if fmt.get('\'targetDurationSec\''):$/,/ continue$/s/^/#/' "$(pip show yt-dlp | grep Location | awk '{print $2}')/yt_dlp/extractor/youtube.py" diff --git a/config.py b/config.py index b24d54e..bd7766e 100644 --- a/config.py +++ b/config.py @@ -68,7 +68,8 @@ look_ahead = 48 # Cookies file location relative to inside the container -cookies_file = "/app/cookies.txt" +#cookies_file = "/app/cookies.txt" +cookies_file = "A:\\Users\\uncle\\Documents\\Scripts\\cookies.txt" ### Torrent options torrent = True @@ -91,4 +92,4 @@ communitydir = "/app/CommunityPosts" unarchiveddir = "/app/unarchived" -unarchivedtempdir = "/app/temp/unarchived" \ No newline at end of file +unarchivedtempdir = "/app/temp/unarchived" diff --git a/downloadVid.py b/downloadVid.py index b280a9d..19c2b04 100644 --- a/downloadVid.py +++ b/downloadVid.py @@ -104,7 +104,7 @@ def download_chat_ytdlp(video_url,outputFile): with yt_dlp.YoutubeDL(options) as ydl: ydl.download(video_url) return 0 -""" + def download_chat(id,outputFile): if getConfig.getChat() and not getConfig.vid_Only(): try: @@ -147,7 +147,7 @@ def download_chat(id,outputFile): print("Compressing chat for {0} failed".format(id)) return 2 return 0 -""" + def replace_ip_in_json(file_name): import re pattern = re.compile(r'((?:[0-9]{1,3}\.){3}[0-9]{1,3})|((?:[a-f0-9]{1,4}:){7}[a-f0-9]{1,4})') @@ -183,12 +183,12 @@ def download_info(id,outputFile): 'live_from_start': True, } - if getConfig.getChat(): - options.update({ - 'writesubtitles': True, - 'subtitleslangs': ['live_chat'], - 'subtitlesformat': 'json', - }) + #if getConfig.getChat(): + # options.update({ + # 'writesubtitles': True, + # 'subtitleslangs': ['livechat'], + # 'subtitlesformat': 'json', + # }) url = 'https://www.youtube.com/watch?v={0}'.format(id) with yt_dlp.YoutubeDL(options) as ydl: @@ -217,10 +217,10 @@ def downloader(id,outputTemplate, members): # Start additional information downloaders discord_notify = threading.Thread(target=discord_web.main, args=(id, "recording"), daemon=True) - #chat_downloader = threading.Thread(target=download_chat, args=(id,output), daemon=True) + chat_downloader = threading.Thread(target=download_chat, args=(id,output), daemon=True) info_downloader = threading.Thread(target=download_info, args=(id,output), daemon=True) discord_notify.start() - #chat_downloader.start() + chat_downloader.start() info_downloader.start() @@ -239,7 +239,7 @@ def downloader(id,outputTemplate, members): return # Wait for remaining processes discord_notify.join() - #chat_downloader.join() + chat_downloader.join() info_downloader.join() if(getConfig.getTorrent()): diff --git a/requirements.txt b/requirements.txt index 00a6028..dbc3064 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ yt-dlp>=2023.10.13 discord-webhook>=1.3.0 -#chat-downloader>=0.2.8 +chat-downloader>=0.2.8 psutil>=5.9.4 py3createtorrent>=1.2.0