Sharedown
Sharedown copied to clipboard
Direct download failed
Using direct download fails for me on Sharedown 3.0.0 with a cryptic message:
sharedownLog.log
:
makeDirectUrl:
rootfolder: /sites/Section_36662_RLB405/Sdilene dokumenty/General/Recordings/Jenom prohlížení/General-20211102_180259-Záznam schůzky.mp4
webUrl: https:,,ucnmuni.sharepoint.com,sites,Section_36662_RLB405
final: https://ucnmuni.sharepoint.com/sites/Section_36662_RLB405/Sdilene dokumenty/General/Recordings/Jenom prohlížení/General-20211102_180259-Záznam schůzky.mp4
runPuppeteerGetVideoData: direct mode: linkAr:
["https:","","ucnmuni.sharepoint.com","sites","Section_36662_RLB405","Sdilene dokumenty","General","Recordings","Jenom prohlížení","General-20211102_180259-Záznam schůzky.mp4"]
cookies: ["KillSwitchOverrides_disableKillSwitches","KillSwitchOverrides_enableKillSwitches","SPWorkLoadAttribution","CCSInfo","FedAuth","rtFa"]
YT-dlp: download failed:
ENOENT: no such file or directory, stat '/home/jtojnar/Downloads/sharedownVideos/General-20211102_180259-Záznam schůzky.mp4'
ytdlp.log
:
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
[generic] General-20211102_180259-Záznam schůzky: Requesting header
[redirect] Following redirect to https://ucnmuni.sharepoint.com/sites/Section_36662_RLB405/_layouts/15/AccessDenied.aspx?correlation=XXXXXXXX%XXXXXX%XXXXXX%XXXXXX%XXXXXXXXXXXXXX
[generic] AccessDenied: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] AccessDenied: Downloading webpage
[generic] AccessDenied: Extracting information
ERROR: Unsupported URL: https://ucnmuni.sharepoint.com/sites/Section_36662_RLB405/_layouts/15/AccessDenied.aspx?correlation=XXXXXXXX%XXXXXX%XXXXXX%XXXXXX%XXXXXXXXXXXXXX
:warning: Additionally, Sharedown deletes the directory it is run from on the failure. Fortunately, I did not execute it normally so I only lost four months of changes of a Git repository I did not push to https://github.com/NixOS/nixpkgs, not the home directory :sob:
This line is the likely culprit https://github.com/kylon/Sharedown/blob/d083a530df86f54e27660ee2d547155e0223ff3d/preload.js#L659
warning Additionally, Sharedown deletes the directory it is run from on the failure. Fortunately, I did not execute it normally so I only lost four months of changes of a Git repository I did not push to https://github.com/NixOS/nixpkgs, not the home directory sob
i'm really sorry about that this is not inteded behaviour
i was able to reproduce, yes, that could to be the problem, a if
is missing there :(
Maybe defaulting these to null
would be safer, since that will crash fs.rmSync
, path.resolve
and path.join
, greatly reducing another incident like that when refactoring:
https://github.com/kylon/Sharedown/blob/d083a530df86f54e27660ee2d547155e0223ff3d/preload.js#L557-L559
yea, thanks, fixing this now and simplifying a bit to hopefully prevent future oversights
do you get a different error with 3.0.1?
makeDirectUrl:
rootfolder: /sites/Section_36662_RLB405/Sdilene dokumenty/General/Recordings/Jenom prohlížení/General-20211102_180259-Záznam schůzky.mp4
webUrl: https:,,ucnmuni.sharepoint.com,sites,Section_36662_RLB405
final: https://ucnmuni.sharepoint.com/sites/Section_36662_RLB405/Sdilene dokumenty/General/Recordings/Jenom prohlížení/General-20211102_180259-Záznam schůzky.mp4
runPuppeteerGetVideoData: direct mode: linkAr:
["https:","","ucnmuni.sharepoint.com","sites","Section_36662_RLB405","Sdilene dokumenty","General","Recordings","Jenom prohlížení","General-20211102_180259-Záznam schůzky.mp4"]
cookies: ["KillSwitchOverrides_disableKillSwitches","KillSwitchOverrides_enableKillSwitches","SPWorkLoadAttribution","CCSInfo","FedAuth","rtFa"]
YT-dlp: download failed:
Exit code: 1
[generic] General-20211102_180259-Záznam schůzky: Requesting header
[redirect] Following redirect to https://ucnmuni.sharepoint.com/sites/Section_36662_RLB405/_layouts/15/AccessDenied.aspx?correlation=4abb06a0%2D60ad%2D3000%2D55fc%2D1dcb4c71199c
[generic] AccessDenied: Requesting header
WARNING: [generic] Falling back on generic information extractor.
[generic] AccessDenied: Downloading webpage
[generic] AccessDenied: Extracting information
ERROR: Unsupported URL: https://ucnmuni.sharepoint.com/sites/Section_36662_RLB405/_layouts/15/AccessDenied.aspx?correlation=4abb06a0%2D60ad%2D3000%2D55fc%2D1dcb4c71199c
This line is the likely culprit
https://github.com/kylon/Sharedown/blob/d083a530df86f54e27660ee2d547155e0223ff3d/preload.js#L659
I couldn't figure out how that line could be causing your repo to get deleted. As per below line, tmp folder always tries to delete sharedownTmp. https://github.com/kylon/Sharedown/blob/d083a530df86f54e27660ee2d547155e0223ff3d/preload.js#L566
That line only got called when isDirect
was false
. In my case, isDirect
was true
so tmpFold
remained an empty string and _path.resolve('')
evaluated to $PWD
.
Thankfully, that was fixed in https://github.com/kylon/Sharedown/commit/db8e80a997b3b8ad1abd9d9951d094e4136c6ccd