Skip to content

Commit

Permalink
v0.32.0
Browse files Browse the repository at this point in the history
path fixes
  • Loading branch information
awirthy committed Feb 22, 2023
1 parent 6521df9 commit 50be33d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
16 changes: 8 additions & 8 deletions DownloadYouTubePlex.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def Run_YTDLP(sMediaFolder, pName, pChannelID, pFileFormat, pDownloadArchive, pF
# ======================================================== #
# ============== Download Channel JSON Only ============== #
# ======================================================== #
bashcmd3 = 'yt-dlp -v -o "' + sMediaFolder + pChannelID + '/Season 01/' + pChannelID + '.%(ext)s" --write-info-json --playlist-items 0 --restrict-filenames --add-metadata --merge-output-format ' + pFileFormat + ' --format ' + pFileQuality + ' --abort-on-error --abort-on-unavailable-fragment --no-overwrites --continue ' + pYouTubeURL
bashcmd3 = 'yt-dlp -v -o ' + sMediaFolder + pChannelID + '/Season_1/' + pChannelID + '.%(ext)s --write-info-json --playlist-items 0 --restrict-filenames --add-metadata --merge-output-format ' + pFileFormat + ' --format ' + pFileQuality + ' --abort-on-error --abort-on-unavailable-fragment --no-overwrites --continue ' + pYouTubeURL
# bashcmd = "yt-dlp -v -o '" + sMediaFolder + pChannelID + "/%(id)s.%(ext)s' --write-info-json --external-downloader aria2c --external-downloader-args '-c -j 10 -x 10 -s 10 -k 1M' --playlist-items 1,2,3,4,5,3,4,5 --restrict-filenames --download-archive '" + pDownloadArchive + "' --add-metadata --merge-output-format " + pFileFormat + " --format " + pFileQuality + " --abort-on-error --abort-on-unavailable-fragment --no-overwrites --continue --write-description " + pYouTubeURL
# print(bashcmd)

Expand All @@ -67,7 +67,7 @@ def Run_YTDLP(sMediaFolder, pName, pChannelID, pFileFormat, pDownloadArchive, pF
# ======================================================== #

pubDate = time.strftime('%Y%m%d%H%M')
bashcmd = 'yt-dlp -v -o "' + sMediaFolder + pChannelID + '/Season 1/%(id)s.%(ext)s" --write-info-json --no-write-playlist-metafiles --playlist-items 1,2 --restrict-filenames --add-metadata --no-embed-thumbnail --merge-output-format ' + pFileFormat + ' --format ' + pFileQuality + ' --abort-on-error --abort-on-unavailable-fragment --no-overwrites --continue --write-description ' + pYouTubeURL
bashcmd = 'yt-dlp -v -o ' + sMediaFolder + pChannelID + '/Season_1/%(id)s.%(ext)s --write-info-json --no-write-playlist-metafiles --playlist-items 1,2 --restrict-filenames --add-metadata --no-embed-thumbnail --merge-output-format ' + pFileFormat + ' --format ' + pFileQuality + ' --abort-on-error --abort-on-unavailable-fragment --no-overwrites --continue --write-description ' + pYouTubeURL
# bashcmd = "yt-dlp -v -o '" + sMediaFolder + pChannelID + "/%(id)s.%(ext)s' --write-info-json --external-downloader aria2c --external-downloader-args '-c -j 10 -x 10 -s 10 -k 1M' --playlist-items 1,2,3,4,5,3,4,5 --restrict-filenames --download-archive '" + pDownloadArchive + "' --add-metadata --merge-output-format " + pFileFormat + " --format " + pFileQuality + " --abort-on-error --abort-on-unavailable-fragment --no-overwrites --continue --write-description " + pYouTubeURL
print ('------------------ \n\n')
print("bashcmd: " + bashcmd)
Expand All @@ -90,7 +90,7 @@ def Run_YTDLP(sMediaFolder, pName, pChannelID, pFileFormat, pDownloadArchive, pF
try:
print("List Files")

directory = os.fsencode(sMediaFolder + pChannelID + "/Season 01")
directory = os.fsencode(sMediaFolder + pChannelID + "/Season_1")

for file in os.listdir(directory):
filename = os.fsdecode(file)
Expand All @@ -109,9 +109,9 @@ def Run_YTDLP(sMediaFolder, pName, pChannelID, pFileFormat, pDownloadArchive, pF
print (err)
print ('\n------------------ END GET EXT ERROR')

filename_json = sMediaFolder + pChannelID + "/Season 1/" + filename_noext + ".info.json"
filename_mp3 = sMediaFolder + pChannelID + "/Season 1/" + filename_noext + ".mp3"
filename_mp4 = sMediaFolder + pChannelID + "/Season 1/" + filename_noext + ".mp4"
filename_json = sMediaFolder + pChannelID + "/Season_1/" + filename_noext + ".info.json"
filename_mp3 = sMediaFolder + pChannelID + "/Season_1/" + filename_noext + ".mp3"
filename_mp4 = sMediaFolder + pChannelID + "/Season_1/" + filename_noext + ".mp4"

print("filename_json: " + filename_json)
print("filename_mp3: " + filename_mp3)
Expand Down Expand Up @@ -220,15 +220,15 @@ def Run_YTDLP(sMediaFolder, pName, pChannelID, pFileFormat, pDownloadArchive, pF
# ======================================================== #

print ('------------------ Download Thumbnail\n')
bashcmdoutput = 'wget -O "' + sMediaFolder + pChannelID + '/Season 1/' + filename_noext + '.jpg" ' + ytvideo_thumbnail
bashcmdoutput = 'wget -O "' + sMediaFolder + pChannelID + '/Season_1/' + filename_noext + '.jpg" ' + ytvideo_thumbnail
print("bashcmd: " + bashcmdoutput)
processoutput = subprocess.Popen(bashcmdoutput.split(), stdout=subprocess.PIPE)
outputthumb, erroroutput = processoutput.communicate()

# ======================================================== #
# ================ Get Channel Information =============== #
# ======================================================== #
channel_filename_json = sMediaFolder + pChannelID + "/Season 1/" + pChannelID + ".info.json"
channel_filename_json = sMediaFolder + pChannelID + "/Season_1/" + pChannelID + ".info.json"
channelf = open(channel_filename_json)
channeldata = json.load(channelf)
ytvideo_channel_desc = channeldata['description']
Expand Down
2 changes: 1 addition & 1 deletion DownloadYouTubePlex.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# /etc/cron.d/ytdl
#
python3 -m pip install -U yt-dlp
python3 /opt/DownloadYouTubePlex/DownloadYouTubePlex-0.31.0/DownloadYouTubePlex.py >> /proc/1/fd/1;
python3 /opt/DownloadYouTubePlex/DownloadYouTubePlex-0.32.0/DownloadYouTubePlex.py >> /proc/1/fd/1;
echo "DONE" >> /proc/1/fd/1;
10 changes: 5 additions & 5 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ RUN pip install email-validator
RUN python3 -m pip install requests-html
RUN cp /usr/share/zoneinfo/Australia/Melbourne /etc/localtime
RUN echo "Australia/Melbourne" > /etc/timezone
RUN wget -O /tmp/DownloadYouTubePlex.tar.gz https://github.com/awirthy/DownloadYouTubePlex/archive/refs/tags/v0.31.0.tar.gz
RUN wget -O /tmp/DownloadYouTubePlex.tar.gz https://github.com/awirthy/DownloadYouTubePlex/archive/refs/tags/v0.32.0.tar.gz
RUN mkdir -p /opt/DownloadYouTubePlex
RUN tar zxf /tmp/DownloadYouTubePlex.tar.gz -C /opt/DownloadYouTubePlex
RUN echo "#!/bin/sh" >> /etc/periodic/15min/DownloadYouTubePlex
RUN echo "/opt/DownloadYouTubePlex/DownloadYouTubePlex-0.31.0/DownloadYouTubePlex.sh" >> /etc/periodic/15min/DownloadYouTubePlex
RUN chmod 755 /opt/DownloadYouTubePlex/DownloadYouTubePlex-0.31.0/DownloadYouTubePlex.sh
RUN chmod 755 /etc/periodic/15min/DownloadYouTubePlex
# RUN echo "#!/bin/sh" >> /etc/periodic/15min/DownloadYouTubePlex
# RUN echo "/opt/DownloadYouTubePlex/DownloadYouTubePlex-0.32.0/DownloadYouTubePlex.sh" >> /etc/periodic/15min/DownloadYouTubePlex
# RUN chmod 755 /opt/DownloadYouTubePlex/DownloadYouTubePlex-0.32.0/DownloadYouTubePlex.sh
# RUN chmod 755 /etc/periodic/15min/DownloadYouTubePlex
CMD ["crond", "-f","-l","8"]

###############################################################################
Expand Down

0 comments on commit 50be33d

Please sign in to comment.