forked from cinemafactory2/Hotstar-Video-Downloader
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathredirect_google.php
32 lines (29 loc) · 1.04 KB
/
redirect_google.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<html>
<head>
<title>Google drive upload redirect</title>
<!-- HTTP 1.1 -->
<meta http-equiv="Cache-Control" content="no-store"/>
<!-- HTTP 1.0 -->
<meta http-equiv="Pragma" content="no-cache"/>
<!-- Prevents caching at the Proxy Server -->
<meta http-equiv="Expires" content="0"/>
<script src="js/cookies.min.1.2.3.js"></script>
<script type="text/javascript">
function getQueryStringValue(url, key) {
return decodeURIComponent(url.replace(new RegExp("^(?:.*[&\\?]" + encodeURIComponent(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1"));
}
var currentPageUrl=window.location.href;
var isAuthCodeAvailable = (currentPageUrl.indexOf("code=") != -1);
if(isAuthCodeAvailable) {
var authCode = getQueryStringValue(currentPageUrl, "code");
if(Cookies.enabled) {
Cookies.set('GoogleDriveAuthCode', authCode);
Cookies.set('GoogleDriveAuthRedirectUri', currentPageUrl);
}
}
</script>
</head>
<body>
This is page will close automatically once authentication is done.
</body>
</html>