Garmelon/PFERD

Problem with downloading duplicated video names

bestlinuxgamers opened this issue · 4 comments

It seems to be possible to upload several videos with the same file name to one folder on ilias.
PFERD detects them, but doesn't download them:

Downloaded  'Folder/Name 04.mp4' 
Added       'Folder/Name 04.mp4' 
Downloaded  'Folder/Name 04 1.mp4' 

There is no such file as Name 04 1.mp4 in Folder. Only Name 04.mp4.

Is there any additional info related to those files if you run it again with --explain?

This is the console log with --explain:

Parsing HTML page for 'Folder'
  URL: URL
  Unwrapping video pagination
  Disabled pagination, retrying folder as a new entry
Parsing HTML page for 'Folder'
  URL: URL
  Page is an opencast video listing, searching for elements
  [...]
  Found video 'Name 04.mp4' at URL
  [...]
  Found video 'Name 04.mp4' at URL
  [...]
Crawled     'Folder' 
Decision: Download 'Folder/Name 04.mp4'
  Testing rule 1: ^Tutorien\/Tutorium\s(?!01\b).+$ -re-> !
  Final result: 'Folder/Name 04.mp4'
  No corresponding file present locally
  Answer: Yes
Checking local cache for video Name 04.mp4
  Testing rule 1: ^Tutorien\/Tutorium\s(?!01\b).+$ -re-> !
  Final result: 'Folder/Name 04.mp4'
  Missing at least one video, continuing with requests!
Decision: Download 'Folder/Name 04.mp4'
  Path 'Folder/Name 04.mp4' is already taken, finding a new name
  Found unused path 'Folder/Name 04 1.mp4'
  Testing rule 1: ^Tutorien\/Tutorium\s(?!01\b).+$ -re-> !
  Final result: 'Folder/Name 04 1.mp4'
  No corresponding file present locally
  Answer: Yes
Checking local cache for video Name 04.mp4
  Testing rule 1: ^Tutorien\/Tutorium\s(?!01\b).+$ -re-> !
  Final result: 'Folder/Name 04.mp4'
  Missing at least one video, continuing with requests!

[...]

  Page is a video player, extracting URL
  Using single video mode for Name 04.mp4
  Testing rule 1: ^Tutorien\/Tutorium\s(?!01\b).+$ -re-> !
  Final result: 'Folder/Name 04.mp4'
Downloaded  'Folder/Name 04.mp4' 
Processing downloaded file for 'Folder/Name 04.mp4'
  Updating file metadata
Added       'Folder/Name 04.mp4' 
  Page is a video player, extracting URL
  Using single video mode for Name 04.mp4
  Testing rule 1: ^Tutorien\/Tutorium\s(?!01\b).+$ -re-> !
  Final result: 'Folder/Name 04.mp4'
  Video for Name 04.mp4 existed locally
Downloaded  'Folder/Name 04 1.mp4' 
Processing downloaded file for 'Folder/Name 04 1.mp4'
  Download unsuccessful, aborting

Download unsuccessful, aborting seems interesting. But no further error is displayed.

I have good and bad news.

The good news: I think this should be fixed by a117126

The bad news: It throws away your local video cache, so it will re-download all videos once.

You can try it either by upgrading to @master instead of @latest, using the result of this action run or updating your Nix flake (gc it, run again or whatever else you like).

Thank you very much! With this new commit everything works properly.