RandomNinjaAtk / docker-lidarr-extended

lidarr-extended :: Lidarr application packaged with multiple scripts to provide additional functionality
GNU General Public License v3.0
277 stars 24 forks source link

Rescan music videos after failed download #47

Closed lakafior closed 2 years ago

lakafior commented 2 years ago

Hi, First of all great work with project, everything is running smooth. But I have one question.

First, I ran the script without connecting the Tidal account. It succeeded in downloading most of the music videos, but a lot, despite finding them in IMVDB, failed. It left .nfo and .jpg files in the artist folder, but not .mkv. obraz

I then added a Tidal account, but once failed downloads are skipped and not checked in Tidal, making me have to search for these failed downloads and download manually by tidal-dl or other tools and inserting into music videos folder.

I wrote a script in python to make it easier for myself. It returns in a csv file the name of the performer, the file and the number of occurrences of the file without the extension. I can then filter out all occurrences below 3 and search for them manually. obraz

from glob import glob
import pandas as pd
from pathlib import Path

musicvideo = r'\\168.0.1.10\media\TELEDYSKI'
finalfile = r'C:/Users/Marcin/Downloads/musicvideos.csv'
removepath = len(musicvideo)+1
removepath = int(removepath)

os.chdir(musicvideo)
print("Enter folder with music videos")

nfo=[]
for path, subdirs, files in os.walk(musicvideo):
    for base_filename  in files:
        sciezka = os.path.join(path[removepath:], base_filename[:-4])
        #sciezka = Path(path, base_filename)
        nfo.append(sciezka)

print("Making dataframe")
df = pd.DataFrame(nfo, columns =['Files'])

df = df.groupby(df.columns.tolist()).size().reset_index().rename(columns={0:'records'})

print("Savinng file")
df.to_csv('C:/Users/Marcin/Downloads/musicvideos.csv', encoding='utf-8', sep='\t', index=False)

But it's not ideal, as I have couple hundreds of rows to manually download. So my questions is: Could I force yours script to research with both Tidal and YT and try again to download if there is no video file, just nfo and jpg?

Log in attcachment extended_video_script_run_1_2022_08_08_04_25_PM.txt

RandomNinjaAtk commented 2 years ago

Some decent changes were made to the script for naming files. It actually might be best for you to purge music-vidoes entirely and retry.

The script will only create "jpg" and "nfo" files for completed downloads, where as previously like you experienced, a download could fail but still produce those files.

So you should update to the latest code, purge your music-video library and have it try again. Not ideal, but it is what it is...

Edit: FYI, unless people start adding links for tidal videos to musicbrainz site, you probably won't get that many at this time...

lakafior commented 2 years ago

Ok thanks for reply! I'll try to change my script to delete all files with only 2 occurrences of the same name without extension - it should remove all orphaned .nfo and .jpg without touching downloaded music videos and then rerun yours script. Should it work? I mean if there is no .nfo and .jpg it will check this position as non downloaded? It is downloading second day already so it would be a shame to start everything again.

Well this is also a problem with generally discographies on musicbrainz - lack of community to support it. I'll add those videos when start manual phase of downloading everyting that script couldn't find ;)

RandomNinjaAtk commented 2 years ago

Even if you delete the files, because the main file names were changed in the most recent version to better accommodate Plex not using nfo's, your local files may not match the new file names, and you'll end up with dupes as a result, because dupe checking is only handled by matching file names...

lakafior commented 2 years ago

Ok I get it. So I'll purge everything and start again, not a big deal - better then manual work without this script. Thanks again for reply and I'm closing thread.

RandomNinjaAtk commented 2 years ago

For reference, this fixed the creation of jpg/nfo files for failed downloads: https://github.com/RandomNinjaAtk/docker-lidarr-extended/commit/9b78d5a734ce55d91c64e2f0ad51f3e19734a610

lakafior commented 2 years ago

Looks cool, the more conditional statements the better :D I get it that sometimes it's impossible to maintain backward compatibility when changing logic of algorithm. I appreciate that you continue to develop the project and have added new life to Lidarr!