快手随机视频解析接口php

折腾 45 字 594 阅

简言

对接快手接口,当随机时遇到图集会返回空值,请自行修复。

代码

<?php

$data=get_curl("https://apissl.gifshow.com/rest/nebula/feed/hot?ll=CZT1m4npNjtAEQySPq2iW1pA&mod=meizu%2816s%29&appver=2.6.1.425&isp=CUCC&cold=false&lon=105.431804&language=zh-cn&sys=ANDROID_9&max_memory=256&ud=1345840440&egid=DFPC10857A24C5CDE6F6C34975D82BA3162CCA38863FFE68FC78C3115BCA1C29&pm_tag=&oc=MEIZU&sh=2232&browseType=3&ddpi=540&extId=2306b9565b7a726857d189ab0de14594&net=WIFI&socName=Qualcomm%20Snapdragon%208150&lat=27.214501&kcv=193&app=0&kpf=ANDROID_PHONE&ver=2.6&c=MEIZU&sw=1080&ftt=K-T-T&apptype=22&kpn=NEBULA&newOc=MEIZU&country_code=cn&nbh=108&hotfix_ver=&did_gt=1572003559755&iuid=&sbh=95&darkMode=false&did=ANDROID_1960c21d25a3fcf2","type=7&page=1&coldStart=false&count=20&pv=false&id=50&refreshTimes=3&pcursor=&source=2&needInterestTag=false&seid=b6c9aa0d-a506-4fb4-b474-48a9e4f95d7e&volume=0.4&backRefresh=false&pageCount=4&adChannel=&passThrough=0&thanosSpring=false&newUserRefreshTimes=-1&recoReportContext=%7B%22pullUpFresh%22%3A%221%22%7D&edgeRecoBit=2&realShowPhotoIds=5199405800433820816%2C5224175598514757862&__NStokensig=f5dcd0ab5ceb6635c1d6fa5a43c9a37c83cac34bc27b4ee8d44616502320de81&sig=27c22ebaadc82f49fb7c6d556ceaa0b1&client_key=2ac2a76d&kuaishou.api_st=Cg9rdWFpc2hvdS5hcGkuc3QSoAG4gU4uQB9pOutBQgzfOuYtxdLD33-gtZn22jk53SBnKM8icSpy1Xc_kX63vZqoMwPkddgNptX_Z_ZWA2emjb8fAVzBNVwk_EvVmLXN3mdJ7yOFOPKfVWRU05GR2O7dcZmSe9llzSWdMthNNepKmcalC7C6AtdI-5RiFmCjjLDTRPFowC9IJC4V6akVvXzcj2zkc7OlEJD4s4kEZqF6BAkMGhL608FrZ2RKEaX4x5mnqMPZWrYiIGZo57NK9sec4zqHttwGaShgshesJ-N8vD2CeSlVD35RKAUwAQ&os=android&token=Cg9rdWFpc2hvdS5hcGkuc3QSoAG4gU4uQB9pOutBQgzfOuYtxdLD33-gtZn22jk53SBnKM8icSpy1Xc_kX63vZqoMwPkddgNptX_Z_ZWA2emjb8fAVzBNVwk_EvVmLXN3mdJ7yOFOPKfVWRU05GR2O7dcZmSe9llzSWdMthNNepKmcalC7C6AtdI-5RiFmCjjLDTRPFowC9IJC4V6akVvXzcj2zkc7OlEJD4s4kEZqF6BAkMGhL608FrZ2RKEaX4x5mnqMPZWrYiIGZo57NK9sec4zqHttwGaShgshesJ-N8vD2CeSlVD35RKAUwAQ&__NS_sig3=2196214649d588a926616f7eb4e61bf0e1697654f4","0","token=Cg9rdWFpc2hvdS5hcGkuc3QSoAG4gU4uQB9pOutBQgzfOuYtxdLD33-gtZn22jk53SBnKM8icSpy1Xc_kX63vZqoMwPkddgNptX_Z_ZWA2emjb8fAVzBNVwk_EvVmLXN3mdJ7yOFOPKfVWRU05GR2O7dcZmSe9llzSWdMthNNepKmcalC7C6AtdI-5RiFmCjjLDTRPFowC9IJC4V6akVvXzcj2zkc7OlEJD4s4kEZqF6BAkMGhL608FrZ2RKEaX4x5mnqMPZWrYiIGZo57NK9sec4zqHttwGaShgshesJ-N8vD2CeSlVD35RKAUwAQ");
$json = json_decode($data, true);
$i=rand(0,count($json["feeds"]));
echo $json["feeds"][$i]["photoDescription"]."\n分享数:".$json["feeds"][$i]["share_count"]."\n播放量:".$json["feeds"][$i]["view_count"]."\n收藏量:".$json["feeds"][$i]["like_count"]."\n播放链接:".$json["feeds"][$i]["adaptationSet"][0]["representation"][0]["urls"][0]["url"];




function get_curl($url,$post=0,$referer=1,$cookie=0,$header=0,$ua=1,$nobaody=0,$json=0){
$ch = curl_init();
@curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$httpheader[] = "Accept:application/json";
$httpheader[] = "Accept-Encoding:gzip,deflate,sdch";
$httpheader[] = "Accept-Language:zh-CN,zh;q=0.8";
$httpheader[] = "Connection:close";
if($json){
$httpheader[] = "Content-Type:application/json; charset=utf-8";}
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
if($post){
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);}
if($header){
curl_setopt($ch, CURLOPT_HEADER, TRUE);}
if($cookie){
curl_setopt($ch, CURLOPT_COOKIE, $cookie);}
if($referer){
if($referer==1){
curl_setopt($ch, CURLOPT_REFERER, 'http://m.qzone.com/infocenter?g_f=');
}else{
curl_setopt($ch, CURLOPT_REFERER, $referer);
}}
if($ua){
curl_setopt($ch, CURLOPT_USERAGENT,$ua);
}else{
curl_setopt($ch, CURLOPT_USERAGENT,'Dalvik/2.1.0 (Linux; U; Android 9; 16s Build/PKQ1.190202.001)');}
if($nobaody){
curl_setopt($ch, CURLOPT_NOBODY,1);}
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$ret = curl_exec($ch);
curl_close($ch);
//$ret=mb_convert_encoding($ret, "UTF-8", "UTF-8");
return $ret;}
?>

Demo

查看事例

- THE END -
打赏 分享
评论 ( 49 )
OωO
  1. Wnwtrb

    stromectol for humans for sale - can i buy ivermectin online buy ivermectin 6mg

    昨天 22:55 回复
  2. Lzzknf

    cost of sildenafil 100 mg tablet - Buy viagra overnight delivery buy generic viagra online cheap

    一天前 回复
  3. Xvlqdu

    buy an essay paper - best essay service thesis writers

  4. Lzquvw

    casino slots - slots online doubleu casino online casino

  5. Opxhyn

    ivermectin lotion cost - price of ivermectin ivermectin lotion for scabies

  6. Gpqjjg

    ivermectin 3mg dosage - cost of ivermectin lotion ivermectin buy australia

  7. Cgwmyt

    tadalafil cheap no prescription - Generic cialis cheap buy cialis online nz

    10月18日 回复
  8. Mllysf

    genuine cialis for sale - cialis 20mg cialis 5mg daily

    10月17日 回复
  9. Qyamfq

    generic viagra on line - sildenafil otc viagra pills 200mg

    10月16日 回复
  10. Vliyns

    online viagra in usa - buy viagra illinois viagra price pfizer

    10月15日 回复
  11. Bpznsw

    ivermectin 2ml - stromectol buy nz order stromectol

    10月13日 回复
  12. Xkfwyy

    ivermectin 2 - site ivermectin 200mg

    10月12日 回复
  13. Kdwvtt

    prednisone 10mg online - prednipill.com prednisone price australia

    10月9日 回复
  14. Rmuxxa

    generic cialis for women - cialis daily cost tadalafil 5mg daily mexico

    10月9日 回复
  15. Qgpysb

    online pharmacy 365 pills - what is cialis cialis 500mg

    10月7日 回复
  16. Xaqrhm

    viagra 8000mg - viagra 25mg viagra 200mg pills

    10月6日 回复
  17. Fqzljy

    ivermectin 400 mg brands - stromectol stromectol buy ivermectin 50mg/ml

    10月5日 回复
  18. Ptrxsu

    xenical capsule - orlistat 60 mg price orlistat diet pill

    10月4日 回复
  19. Ugmsnr

    cenforce 120 usa and uk - fildena 100 cenforce 200mg

    10月3日 回复
  20. Arnkfx

    hydroxychloroquine company name - prednisone 10 prednisone 20 mg

    10月2日 回复
  21. Ruhnen

    stromectol 3mg cost - ivermectin cost ivermectin 1% cream generic

    9月26日 回复
  22. Zcmofp

    money can t buy everything essay - essays writing where can i buy an essay

    9月25日 回复
  23. Oskwnl

    accutane rx - buy accutane online usa generic accutane cost

    9月24日 回复
  24. Hgyaxy

    tadalafil tablets - tadalafills.com buy tadalafil

    9月23日 回复
  25. Ylcokm

    sildenafil samples - discount sildenafil what is sildenafil

    9月21日 回复
  26. Ggotxq

    buy stromectol 3mg - ivermectin cost in usa stromectol nz

    9月20日 回复
  27. Tjlyry

    ivermectin eye drops - ivermectin lice oral where to buy stromectol online

    9月19日 回复
  28. Qcyzjc

    doxycycline cap tab 100mg - doxycycline canada pharmacy online pharmacy uk prednisolone

    9月18日 回复
  29. Piyunu

    cytotec online pharmacy with paypal - where to get cytotec pills in south africa cytotec uk

    9月16日 回复
  30. Alztya

    buy ventolin - cheap albuterol ventolin cost usa

    9月15日 回复
  31. Gmpijs

    furosemide 12.5 mg without prescription - buy clomiphene furosemide 80 mg tablet

    9月14日 回复
  32. Avctlw

    prednisone 20mg price - cost of prednisone 10 mg tablet buy prednisone tablets uk

    9月13日 回复
  33. Vznkas

    stromectol price usa - ivermectin humans ivermectin 400 mg

    9月12日 回复
  34. Lrgcok

    discount tadalafil - Cialis delivery tadalafil rx

    9月9日 回复
  35. Lvhcel

    where to buy sildenafil canada - Buy viagra online cheap viagra 100mg price

    9月8日 回复
  36. Ikbzhx

    buying a research paper for college - custom law essay research papers writing

    9月7日 回复
  37. Luyjhj

    medrol 16 mg tablet price - lyrica 150 price lyrica

    9月5日 回复
  38. Uqulio

    buy amoxicillin 500 mg canada - amoxicillin sales worldwide amoxicillin for sale in us

    9月4日 回复
  39. Hjflvy

    where can i get accutane uk - accutane cream for sale accutane online pharmacy india

    9月3日 回复
  40. Djnnsh

    buying prednisone online - prednisone 20 mg tablet cost prednisone 30 mg price

    9月2日 回复
  41. Kutkzo

    stromectol 3 mg tablet - buy oral ivermectin price of ivermectin

    8月31日 回复
  42. Dpibgx

    generic vardenafil 10 mg - viagra vs cialis vs vardenafil order vardenafil uk

    8月30日 回复
  43. Wasvwc

    order cialis online us pharmacy - purchase cialis in mexico

    8月29日 回复
  44. Upgupw

    female viagra pill prescription - sildenafil online pharmacy

    8月27日 回复
  45. Lwnrel

    neurontin 400 - neurontin 800 mg synthroid 137 mcg

    8月26日 回复
  46. Fysoil

    order doxycycline online australia - how much is doxycycline in south africa doxycycline tablets where to buy

    8月24日 回复
  47. Oyttzc

    cytotec pill canada - cytotec price in mexico cytotec pharmacy uk

    8月23日 回复
  48. Stdhlq

    ventolin medication - ventolin price australia ventolin australia price

    8月21日 回复
  49. Cygrub

    buy stromectol 2mg - ivermectin for humans cost stromectol

    8月20日 回复
感谢打赏