Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming media recording forum > Video stream recording
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 10-20-2014, 05:29 AM
onodera onodera is offline
Junior Member
 
Join Date: Oct 2014
Posts: 1
onodera is on a distinguished road
Default

Python how to download protected files


I would like to download a "token" protected file and to use my cookie file in order to avoid multiple re-login. The way i proceed is as follow

First of all, import the cookie

Code:
import requests, cookielib

    cj = cookielib.MozillaCookieJar('cookies.txt')
    cj.load()
    r = requests.get(url, cookies=cj)
This is where i get a problem with, I must follow these steps in order to successfully download the desired file. (Everything in square brackets have to be replaced)

Code:
>> http://videoXXXXXXXX.fr/index.php?optio … &video_id=[VIDEO_ID]&load=1
Recover the cookie provided via "header set-cookie" 
>> http://videoXXXXXXXX.fr/index.php?optio … &video_id=[VIDEO_ID]
Recover the "order_id" in the sent back page [ORDER_ID]
>> http://videoXXXXXXXX.fr/index.php?optio … &order_id=[ORDER_ID]
Recover the response token: [Token]
>> http://videoXXXXXXXX.fr/index.php?optio … raw&token=[Token]&order_id=[ORDER_ID]
This step allow the activation of the cookie recovered in step 1 as well as to obtain the complete file
>> http://videoXXXXXXXX.fr/picture_[VIDEO_ID].png
But the truth is, I would like some help in order to do all that in "Python"

Thank you in advance for your time, as well as your help.
Reply With Quote
Reply Post New Thread
Tags:



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 04:28 PM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons