RobinJ1995 / gopro-cloud-media-downloader

A Node.js command line utility to bulk download files from the GoPro Cloud.
7 stars 1 forks source link

The SCAN_LOCAL_DIR function doesn't seem to work properly #9

Open Telsenome opened 1 year ago

Telsenome commented 1 year ago

What I did: After https://github.com/RobinJ1995/gopro-cloud-media-downloader/issues/8 was fixed I deleted the state.json file as well as all video files that were mistakenly downloaded in a lower resolution than the highest. Then I provided a directory where all the video files of correct resolution were stored and the script noted that I had 378 downloaded files, but then proceeded to redownload these files again anyway.

Telsenome commented 1 year ago

Or could the issue be that the script defaults to another version of the file when it's re-run? Because I experience another issue now which is that concatenated files don't seem to be downloaded in the full length version anymore, but instead part 1 is downloaded.

image

Telsenome commented 1 year ago

Here's an example of a file that's been downloaded twice and the second time just part 1 was downloaded:

image

Telsenome commented 1 year ago

I've done some additional debugging and I think the issue could be caused by the script looking at the source label. This particular video is recorded in 1080p so the resolution is not a problem here, the real problem is that the script picks the part 1 file instead of the concatenated file (full length).

image

image

Telsenome commented 1 year ago

Maybe the concat label should have precedence over the source label now that Gopro has started slicing up the files?

🤓️ File GX010026_HERO11Black_B2WPgBwQN9m2N.MP4 has 1 file and 4 variations.
🤓️ Variation 0 has higher width (5312) than currently selected (1280).
🤓️ Highest quality file for GX010026_HERO11Black_B2WPgBwQN9m2N.MP4 detected. {
  width: 5312,
  height: 4648,
  label: 'concat',
  type: 'mp4',
  quality: '4648p'
}
Telsenome commented 1 year ago

I suppose it would just work changing out source to concat and then everything would work like it should, right?

https://github.com/RobinJ1995/gopro-cloud-media-downloader/blob/master/main.js#L261-L264

Telsenome commented 1 year ago

Or could we have access to the file length in this loop? If so, I guess a more sustainable way of doing it would probably be to check the length and the quality and just skip the label part altogether? Because I guess Gopro will do more changes in the future (like concatenating the file if it's older than 14 days like they added last year) ;-)

Telsenome commented 1 year ago

And regarding the SCAN_LOCAL_DIR function which doesn't work anymore. Could the changes made here be the reason as to why the scanning of the local directory has stopped working? That the appending of the fileExtension on line 201 hasn't been added to all the other places and a file name without fileExtension is compared to a file name with the fileExtension?

https://github.com/RobinJ1995/gopro-cloud-media-downloader/commit/fc38b70d490c823c0b9b417b686f3a10cf1fce44