Hướng dẫn viết code Get link server Google Drive


Mình thấy nhiều bạn có nhu cầu Get link server driver để chạy link trực tiếp trên các thiết bị di động mà chưa có kinh nghiệm để thực hiện. Hay tìm nát google cũng không thấy ai chia sẻ cả trong và ngoài nước cũng không có. Thật ra nó cũng không khó. Chỉ với vài code đơn giản là có thể lấy được dữ liệu cần thiết.

Hướng dẫn viết code Get link server Driver :

Đầu tiên, các bạn chuẩn bị 1 link phim trên server Driver: https://docs.google.com/file/d/0BzpExh0WzJF0d1pxbTVuYXNmSWs để view source. Nhưng không giống cách thông thường là Ctrl+U mà sẽ dùng code để đọc dữ liệu :
$get = file_get_contents('https://docs.google.com/file/d/0BzpExh0WzJF0d1pxbTVuYXNmSWs');
echo $get;
Chạy đoạn code trên và bầm Ctrl+U để xem kết quả trả về. Các bạn chỉ cần để ý đoạn sau:

["fmt_stream_map","22|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d22\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427091503\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d53DD37252BE57736982049877004F810ECCC7810.7217D827BC67D6EB43E9589838AC908062E2EB6F\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427087844\u0026mv\u003dm\u0026nh\u003dIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE\u0026pl\u003d20,45|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d45\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427091503\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d3E94B0F7915CFC60C8654BDB79A7FC7AF65F27AE.19900EA397E26449E085B544E665A05A9F7BDEA5\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427087844\u0026mv\u003dm\u0026nh\u003dIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE\u0026pl\u003d20,35|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d35\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427091503\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d93945377FC5276B20C5EC53537FD2168A4A030BD.A480ECD56A6F6027E660589173E92100319C204E\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427087844\u0026mv\u003dm\u0026nh\u003dIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE\u0026pl\u003d20,44|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d44\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427091503\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d8428F453B21BC61C879B3D05B40D428B40D65868.7591A2F456B4BB1460877CA410097A431AFD6886\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427087844\u0026mv\u003dm\u0026nh\u003dIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE\u0026pl\u003d20,34|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d34\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427091503\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d34B72D3A05DD06B5CDACF7B00BFA8B0EAAC62239.A86E9E9DD78990E04A94F3171D195898ADBCF5E3\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427087844\u0026mv\u003dm\u0026nh\u003dIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE\u0026pl\u003d20,18|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d18\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427091503\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d6324C5D538719C55177999757F9D56D332BD2350.1D158C58752F09E7C8DEE8E3C8170957729A10B5\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427087844\u0026mv\u003dm\u0026nh\u003dIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE\u0026pl\u003d20,59|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d59\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427091503\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d6F85E73553A73BE09365D041D36BE6815DC78CD6.895044FC799AD8AD388D9F532F07E97E22D92756\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427087844\u0026mv\u003dm\u0026nh\u003dIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE\u0026pl\u003d20,43|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d43\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427091503\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d9C4FE291CA04816C1C17B25D0A532906D323B5E1.47EAF89F49E945246E061092D68F626EB31A92D6\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427087844\u0026mv\u003dm\u0026nh\u003dIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE\u0026pl\u003d20"]
,["fmt_list","22/1280x720/9/0/115,45/1280x720/99/0/0,35/854x480/9/0/115,44/854x480/99/0/0,34/640x360/9/0/115,18/640x360/9/0/115,59/640x360/9/0/115,43/640x360/99/0/0"]
,["url_encoded_fmt_stream_map","itag\u003d22\u0026url\u003dhttps%3A%2F%2Fr4---sn-i3b7rnel.c.docs.google.com%2Fvideoplayback%3Frequiressl%3Dyes%26shardbypass%3Dyes%26cmbypass%3Dyes%26id%3D9a93c66c4de2a92b%26itag%3D22%26source%3Dwebdrive%26app%3Ddocs%26ip%3D118.71.6.159%26ipbits%3D0%26expire%3D1427091503%26sparams%3Drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire%26signature%3D53DD37252BE57736982049877004F810ECCC7810.7217D827BC67D6EB43E9589838AC908062E2EB6F%26key%3Dck2%26mm%3D30%26ms%3Dnxu%26mt%3D1427087844%26mv%3Dm%26nh%3DIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE%26pl%3D20\u0026type\u003dvideo%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22\u0026quality\u003dhd720,itag\u003d45\u0026url\u003dhttps%3A%2F%2Fr4---sn-i3b7rnel.c.docs.google.com%2Fvideoplayback%3Frequiressl%3Dyes%26shardbypass%3Dyes%26cmbypass%3Dyes%26id%3D9a93c66c4de2a92b%26itag%3D45%26source%3Dwebdrive%26app%3Ddocs%26ip%3D118.71.6.159%26ipbits%3D0%26expire%3D1427091503%26sparams%3Drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire%26signature%3D3E94B0F7915CFC60C8654BDB79A7FC7AF65F27AE.19900EA397E26449E085B544E665A05A9F7BDEA5%26key%3Dck2%26mm%3D30%26ms%3Dnxu%26mt%3D1427087844%26mv%3Dm%26nh%3DIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE%26pl%3D20\u0026type\u003dvideo%2Fwebm\u0026quality\u003dhd720,itag\u003d35\u0026url\u003dhttps%3A%2F%2Fr4---sn-i3b7rnel.c.docs.google.com%2Fvideoplayback%3Frequiressl%3Dyes%26shardbypass%3Dyes%26cmbypass%3Dyes%26id%3D9a93c66c4de2a92b%26itag%3D35%26source%3Dwebdrive%26app%3Ddocs%26ip%3D118.71.6.159%26ipbits%3D0%26expire%3D1427091503%26sparams%3Drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire%26signature%3D93945377FC5276B20C5EC53537FD2168A4A030BD.A480ECD56A6F6027E660589173E92100319C204E%26key%3Dck2%26mm%3D30%26ms%3Dnxu%26mt%3D1427087844%26mv%3Dm%26nh%3DIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE%26pl%3D20\u0026type\u003dvideo%2Fx-flv\u0026quality\u003dlarge,itag\u003d44\u0026url\u003dhttps%3A%2F%2Fr4---sn-i3b7rnel.c.docs.google.com%2Fvideoplayback%3Frequiressl%3Dyes%26shardbypass%3Dyes%26cmbypass%3Dyes%26id%3D9a93c66c4de2a92b%26itag%3D44%26source%3Dwebdrive%26app%3Ddocs%26ip%3D118.71.6.159%26ipbits%3D0%26expire%3D1427091503%26sparams%3Drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire%26signature%3D8428F453B21BC61C879B3D05B40D428B40D65868.7591A2F456B4BB1460877CA410097A431AFD6886%26key%3Dck2%26mm%3D30%26ms%3Dnxu%26mt%3D1427087844%26mv%3Dm%26nh%3DIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE%26pl%3D20\u0026type\u003dvideo%2Fwebm\u0026quality\u003dlarge,itag\u003d34\u0026url\u003dhttps%3A%2F%2Fr4---sn-i3b7rnel.c.docs.google.com%2Fvideoplayback%3Frequiressl%3Dyes%26shardbypass%3Dyes%26cmbypass%3Dyes%26id%3D9a93c66c4de2a92b%26itag%3D34%26source%3Dwebdrive%26app%3Ddocs%26ip%3D118.71.6.159%26ipbits%3D0%26expire%3D1427091503%26sparams%3Drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire%26signature%3D34B72D3A05DD06B5CDACF7B00BFA8B0EAAC62239.A86E9E9DD78990E04A94F3171D195898ADBCF5E3%26key%3Dck2%26mm%3D30%26ms%3Dnxu%26mt%3D1427087844%26mv%3Dm%26nh%3DIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE%26pl%3D20\u0026type\u003dvideo%2Fx-flv\u0026quality\u003dmedium,itag\u003d18\u0026url\u003dhttps%3A%2F%2Fr4---sn-i3b7rnel.c.docs.google.com%2Fvideoplayback%3Frequiressl%3Dyes%26shardbypass%3Dyes%26cmbypass%3Dyes%26id%3D9a93c66c4de2a92b%26itag%3D18%26source%3Dwebdrive%26app%3Ddocs%26ip%3D118.71.6.159%26ipbits%3D0%26expire%3D1427091503%26sparams%3Drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire%26signature%3D6324C5D538719C55177999757F9D56D332BD2350.1D158C58752F09E7C8DEE8E3C8170957729A10B5%26key%3Dck2%26mm%3D30%26ms%3Dnxu%26mt%3D1427087844%26mv%3Dm%26nh%3DIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE%26pl%3D20\u0026type\u003dvideo%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22\u0026quality\u003dmedium,itag\u003d59\u0026url\u003dhttps%3A%2F%2Fr4---sn-i3b7rnel.c.docs.google.com%2Fvideoplayback%3Frequiressl%3Dyes%26shardbypass%3Dyes%26cmbypass%3Dyes%26id%3D9a93c66c4de2a92b%26itag%3D59%26source%3Dwebdrive%26app%3Ddocs%26ip%3D118.71.6.159%26ipbits%3D0%26expire%3D1427091503%26sparams%3Drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire%26signature%3D6F85E73553A73BE09365D041D36BE6815DC78CD6.895044FC799AD8AD388D9F532F07E97E22D92756%26key%3Dck2%26mm%3D30%26ms%3Dnxu%26mt%3D1427087844%26mv%3Dm%26nh%3DIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE%26pl%3D20\u0026type\u003dvideo%2Fmp4%3B+codecs%3D%22avc1.42001E%2C+mp4a.40.2%22\u0026quality\u003dmedium,itag\u003d43\u0026url\u003dhttps%3A%2F%2Fr4---sn-i3b7rnel.c.docs.google.com%2Fvideoplayback%3Frequiressl%3Dyes%26shardbypass%3Dyes%26cmbypass%3Dyes%26id%3D9a93c66c4de2a92b%26itag%3D43%26source%3Dwebdrive%26app%3Ddocs%26ip%3D118.71.6.159%26ipbits%3D0%26expire%3D1427091503%26sparams%3Drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire%26signature%3D9C4FE291CA04816C1C17B25D0A532906D323B5E1.47EAF89F49E945246E061092D68F626EB31A92D6%26key%3Dck2%26mm%3D30%26ms%3Dnxu%26mt%3D1427087844%26mv%3Dm%26nh%3DIgpwcjA0LmhrZzAxKgkxMjcuMC4wLjE%26pl%3D20\u0026type\u003dvideo%2Fwebm\u0026quality\u003dmedium"]
,["timestamp","1427087903959"]
,["length_seconds","1431"]
]
]
Lằng nhằng, nhìn qua không biết là cái gì đúng không. Đó chính là tất cả các link với các định dạng mp4, flv, webm, chính là đoạn chúng ta cần để tách lấy dữ liệu.
Bây giờ mình sẽ lọc lấy dữ liệu cần thiết bằng vài dòng code:

Bây giờ mình sẽ lọc lấy dữ liệu cần thiết bằng vài dòng code:
$cat = explode(',["fmt_stream_map","', $get);
$cat = explode('"]', $cat[1]);
$cat = explode(',', $cat[0]);
print_r($cat); 
Đoạn code này dùng để khoanh vùng dữ liệu cần lấy và in ra bằng hàm print_r
Vậy chúng ta đã Get link thành công bước đầu rồi
Array (
[0] => 22|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d22\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427092052\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d4B22DEB3CE6F29540698F0024ED5245B104D028.2D4388F7476055C612332EAC63F8DFECEC906233\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427088383\u0026mv\u003dm\u0026nh\u003dIgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE\u0026pl\u003d20
[1] => 45|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d45\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427092052\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d7B5F62BE5E2A6E4CF2CE7711103A469F0C3BC4C9.56D403DA3F5E8E91984361D9AD3352A0358855A6\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427088383\u0026mv\u003dm\u0026nh\u003dIgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE\u0026pl\u003d20
[2] => 35|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d35\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427092052\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003dBA178F53568269AA4BE1CD428E71F7DAD891D058.B2D6D9CBA5661941BEC5301072551BBF2BE4E5C2\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427088383\u0026mv\u003dm\u0026nh\u003dIgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE\u0026pl\u003d20
[3] => 44|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d44\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427092052\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d80888A1E2E9A92524A9D968E52C97A52CBCE12D7.98F3E69D6B7BE0EF089880B1B392616B1A2BC9AB\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427088383\u0026mv\u003dm\u0026nh\u003dIgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE\u0026pl\u003d20
[4] => 34|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d34\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427092052\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d3EBCB53265A51B3B49A838E501431566C782918C.6C64C31E2052F51138112AF8797DE7D30693BFCF\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427088383\u0026mv\u003dm\u0026nh\u003dIgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE\u0026pl\u003d20
[5] => 18|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d18\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427092052\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d189B1E31204579AD7B0AFBE4CBE80C5D5F2968CB.3015AF9A075B4F2B597FB62AAC07F2DBC1F7AB3F\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427088383\u0026mv\u003dm\u0026nh\u003dIgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE\u0026pl\u003d20
[6] => 59|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d59\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427092052\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d866A05948A2FF28BAEDF70C71DA389CA221B4D7C.69B84BC3DD4BA7DC6BF154AFA609A7FEBDA27861\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427088383\u0026mv\u003dm\u0026nh\u003dIgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE\u0026pl\u003d20
[7] => 43|https://r4---sn-i3b7rnel.c.docs.google.com/videoplayback?requiressl\u003dyes\u0026shardbypass\u003dyes\u0026cmbypass\u003dyes\u0026id\u003d9a93c66c4de2a92b\u0026itag\u003d43\u0026source\u003dwebdrive\u0026app\u003ddocs\u0026ip\u003d118.71.6.159\u0026ipbits\u003d0\u0026expire\u003d1427092052\u0026sparams\u003drequiressl%2Cshardbypass%2Ccmbypass%2Cid%2Citag%2Csource%2Cip%2Cipbits%2Cexpire\u0026signature\u003d623A13D5CDB53450EF4DEE1DB80210A0FD97102C.7CCE8FED86ABBBDDF9CBDC8CD77D5B3FF48152BB\u0026key\u003dck2\u0026mm\u003d30\u0026ms\u003dnxu\u0026mt\u003d1427088383\u0026mv\u003dm\u0026nh\u003dIgpwcjAxLmhrZzA4KgkxMjcuMC4wLjE\u0026pl\u003d20
)
Các bạn có thấy mấy cái ký tự  \u003d  và  \u0026  trên link không? Chúng ta cần đổi nó về ký tự có thể hiểu:
str_replace(array('\u003d', '\u0026'), array('=', '&'), $cat[1])
Vậy chúng ta đã Get link xong xuôi phần hơi khó rồi.
Các bạn tạo một form đơn giản như sau:
<form action="" method="post">
 <input type="url" name="link" placeholder="Link server drive">
 <input type="submit" value="Get link">
</form>
Code Get link:
if(isset($_POST['link'])) {
 $get = file_get_contents($_POST['link']);
 $cat = explode(',["fmt_stream_map","', $get); $cat = explode('"]', $cat[1]);
 $cat = explode(',', $cat[0]);
 foreach($cat as $link){
  $cat = explode('|', $link);
  $links = str_replace(array('\u003d', '\u0026'), array('=', '&'), $cat[1]);
  if($cat[0] == 37) {$f1080p = $links;}
  if($cat[0] == 22) {$f720p = $links;}
  if($cat[0] == 59) {$f480p = $links;}
  if($cat[0] == 43) {$f360p = $links;}
 }
 if(isset($f1080p)){
  echo '1080p: '.$f1080p.'
720p: '.$f720p.'
480p: '.$f480p.'
360p: '.$f360p;
 } elseif(isset($f720p)){
  echo '720p: '.$f720p.'
480p: '.$f480p.'
360p: '.$f360p;
 } elseif(isset($f480p)){
  echo '480p: '.$f480p.'
360p: '.$f360p;
 } else {
  echo '360p: '.$f360p;
 }
}
Mình đã hướng dẫn các bạn chỗ hơi khó trên code Get link server Driver ở trên.
Share on Google Plus

About NHOCLAK DJ

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.

0 nhận xét:

Đăng nhận xét