-
Notifications
You must be signed in to change notification settings - Fork 3
/
SendVideo.php
46 lines (34 loc) · 1.37 KB
/
SendVideo.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
//-------------------------------------------------------
//Imports
require_once('connections.php');
//Connctions Settings :
ignore_user_abort(true) ;
set_time_limit(0);
//-------------------------------------------------------
xSendVideo($_GET["Url"] , $_GET["SendTo"]);
function xSendVideo($url,$SendTo){
$context = stream_context_create(array('http' => array('header'=>'Connection: close\r\n'))); //Make the conn faster
$time = generateUploadId();
$uuid = uuid();
$video = file_get_contents($url,false,$context);
$post = 'recipient_users=%5B%5B' . $SendTo . '%5D%5D&action=send_item&client_context=&_csrftoken=dZEY078Np5mkwY2KbUSVbZcebusg6nxs&video_result=&_uuid=' . $uuid . '&upload_id=' . $time;
if (UploadVideo1($uuid,$time) == '{"offset":0}'){
if (UploadVideo2($uuid,$time,strlen($video),$video) == '{"xsharing_nonces": {}, "status": "ok"}'){
if (strpos(SendVideo($post), 'thread_id') !== false){
// status --> sent
die($uuid . " : OK");
}else{
sleep(5);
if (strpos(SendVideo($post), 'thread_id') !== false){
// status --> sent
die($uuid . " : OK 2nd");
}else{
// status --> can't send video
die($uuid . " : Fail");
}
}
}
}
}
?>