找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 10610|回复: 140

[iptv信源 资源分享或寻求] 浏览器抓取接口,PHP获取下一页ID实例二:西瓜视频DEMO.PHP

 火.. [复制链接]
发表于 2022-7-31 21:47 | 显示全部楼层 |阅读模式
本帖最后由 jiteloozz 于 2022-8-1 10:29 编辑

根据实例一的方法,如法炮制,得到post接口
https://www.ixigua.com/api/cinema/filterv2/albums
@xjn147  你要的电影ID获取。

西瓜视频电影列表DEMO.PHP,回复可见:

<?php
$id = $_GET['id'] ? $_GET['id'] : '';
if($id==''){
$bstrURL = 'https://www.ixigua.com/api/cinema/filterv2/albums';
for($i=0;$i<10;$i++){
  $post='{"pinyin":"dianying","filters":{"tag":"全部类型","area":"全部地区","type":"电影","sort":"综合排序","paid":"全部资费"},"offset":'.($i*18).',"limit":17}';
  $data =get_data($bstrURL,$post);
  $json=json_decode($data);
  foreach ($json->data->albumList as $va){
    $id=$va->albumId;
    $name=$va->title;
    $tag=$va->tagList[0];
    echo $name.',http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?id='.$id.'&tag='.$tag.'</a><br>';  
    }
  }
}

function get_data($url,$post){
$headers=array(
    'content-type: application/json',
    'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36',
    'referer:https://www.ixigua.com/cinema/filter/dianying/',
    );   
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
if(!empty($post)){
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  }
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}

代码段还有不足,若大神有更好方案,欢迎指正~~~
我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-7-31 21:53 | 显示全部楼层
66666666666666666666666666666666
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-7-31 21:58 | 显示全部楼层
感谢你的分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-7-31 21:59 | 显示全部楼层
如法炮制, 浏览器, php, 回复
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 03:01 | 显示全部楼层
谢谢分享谢谢分享谢谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 05:43 来自手机 | 显示全部楼层
谢分享.......
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 05:46 | 显示全部楼层
感谢你的分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 06:22 | 显示全部楼层
谢谢分享
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 08:08 | 显示全部楼层
来学习一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 08:09 | 显示全部楼层
PHP获取下一页ID实例二
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 08:24 | 显示全部楼层
方法,如法炮制,得到post接口
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 08:38 | 显示全部楼层
看看。。。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 08:42 来自手机 | 显示全部楼层
看看是啥
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 08:46 | 显示全部楼层
浏览器抓取接口,PHP获取下一页ID实例二:西瓜视频DEMO.PHP
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-8-1 08:49 | 显示全部楼层
学习一下知识
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-26 07:41

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表