pvrmza/labsvault

megadl doesn't work with url shortener

Closed this issue · 2 comments

Hi, found your repo when looking for eve-ng labs. Just wanted to let you know that using the kutt.it links in your updateimages script doesn't work because of an issue with megadl.

Here's my fix:

#megaurl=`curl -s $IMAGESLIST | cut -b 23- | sed 's/#/!/g' | sed 's/file\//#!/g'`
megaurl=$(curl -sI $IMAGESLIST | grep ^location | awk '{print $NF}' | sed 's/#/!/g' | sed 's/file\//#!/g')

and down further in the script:

#URL=`curl -s $TINYURL | cut -b 23-`
URL=$(curl -sI $TINYURL | grep ^location | awk '{print $NF}' | sed 's/#/!/g' | sed 's/file\//#!/g')

Hi Clayton. Sorry. I'm new to Github and haven't seen your comment.

I don't understand why to use "sed" to get megaurl. What's more, that breaks the URL and the decryption key

The thing about using "curl -s '+' 'awk' ... I liked it ... I take it!

thanks !

The | sed 's/#/!/g' | sed 's/file\//#!/g' part is because the way that mega allows downloads - you have to replace the ! and file in the url.