Created
June 4, 2013 19:50
-
-
Save vadimii/5708968 to your computer and use it in GitHub Desktop.
HDOut.tv proxy for using alternate video URL and downloading video
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>HDOut · iPhone Proxy</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
</head> | |
<body> | |
<a></a> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> | |
<script> | |
$(function () { | |
var episodeID = location.hash; | |
var dataURL; | |
if (!episodeID) return; | |
episodeID = episodeID.substring(1); | |
if (!episodeID) return; | |
dataURL = '/EpisodeLink/' + episodeID + '/XML/'; | |
$.get(dataURL, function (data) { | |
var data$ = $(data); | |
var videoURL = $("rvideourl", data$).text(); | |
var title = $("etitle", data$).text(); | |
$('a').attr('href', videoURL).text(title); | |
}); | |
}); | |
</script> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@app.route('/EpisodeLink/<episode>/XML/', method=['GET']) | |
def hdout(episode): | |
login = dict(login='mylogin', password='mypass') | |
resp = requests.post('http://hdout.tv', data=login, allow_redirects=False) | |
sid = resp.cookies['SID'] | |
return requests.get('http://hdout.tv/EpisodeLink/{episode}/XML/' | |
.format(episode=episode), cookies={'SID': sid}).text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment