Scenario:
I watch computer based on-line tutorials via a site that uses ASP that allows downloading of their content. When I login and I look at the cookie, I can see that is uses a "AspSessionIdCopy" and a value"
"325434f6-57b2-4b65-8374-blahblahblah"
When I am looking at each video of the course that I am watching I can see that the link is the same with only the number incrementing such as:
Code:
http://www.website.com/home/Player.aspx?lpk4=108148&playChapter=False
http://www.website.com/home/Player.aspx?lpk4=108149&playChapter=False
http://www.website.com/home/Player.aspx?lpk4=108149&playChapter=False
So what I would like to do, is just download the videos using a "for" loop and watch them locally on my laptop at my leisure. Once I know the sequence of numbers of the series, I would proceed in downloading the content. This is my method I will use:
Code:
#!/bin/bash
for (( a=56; a<=96; a++ ))
do
wget -c http://www.website.com/home/Player.aspx?lpk4=10814$a&playChapter=False
done
My question is that I can see that I will have to use authentication on order to be able to do this from the cli and thats the part that I cannot figure out. What is the correct syntax using wget with authentication:
Code:
wget -c username:password@http://www.website.com/home/Player.aspx?lpk4=10814$a&playChapter=False
or
adding to cookies.txt:
Code:
"AspSessionIdCopy 325434f6-57b2-4b65-8374-37ca1ec6ad9f"
Code:
#!/bin/bash
for (( a=56; a<=96; a++ ))
do
wget -c --load-cookies cookies.txt username:password@http://www.website.com/home/Player.aspx?lpk4=10814$a&playChapter=False
done
and download the context that I want. Will this work.
or maybe:
Code:
wget --post-data="username=artiomix&pwd=yourpassword" --cookies=on --keep-session-cookies --save-cookies=cookie.txt "http://www.website.com/member.aspx"
or
Code:
wget --referer="http://www.website.com/members.aspx" --cookies=on --keep-session-cookies --load-cookies=cookie.txt http://www.website.com/home/Player.aspx?lpk4=108148&playChapter=False