Actually it can listen, but ports below 1024 require root privileges. This poses a security risk. So, you can use traffic forwarding. Use firewalld under CentOS 7

systemctl start  firewalld
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080

其实是可以监听的,只是1024以下端口需要使用root权限。这样会有安全隐患。 所以,可以流量转发。 CentOS7下用firewalld

systemctl start  firewalld
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080

Execute with root account, update, add work account, set password, change permissions

yum update
useradd -d /home/work -m work
passwd work
chown -R work:work /home/work
chmod 760 /home/work
visudo
yum install zsh
yum install git

work account: Install omz https://ohmyz.sh/ Install nvm https://github.com/creationix/nvm https://github.com/lukechilds/zsh-nvm nvm install nodejs Install yarn Install pm2

iQiyi

Video page address: https://m.iqiyi.com/v\_19rr2cvmus.html The page will request an interface: https://cache.m.iqiyi.com/, which contains a field m3u, which is the real address of the video. Example: http://netcncallcnc.inter.iqiyi.com/videos/v0/20180720/d9/4f/eddadef77066dc7c960ae952ad83d71a.mp4?key=0035d94084c5cd162a40610306413ea4f&dis\_k=30eb0de0f1341eb0bd743fa691a234f3&dis\_t=1533397020&dis\_dz=CNC-BeiJing&dis\_st=44&src=iqiyi.com&uuid=a0d2dd1-5b65c81c-8c&m=v&qd\_k=9cae95479599021a58e7a683114455a3&sgti=13\_3eprs82wn5ib92y1mp2t6jdg\_1533397019752&qd\_ip=7b7118cf&qd\_p=7b7118cf&dfp=a06680c7961c14486e80f314cd8ffd7f6fa7df798edc359fa022c5d2cfdae1b13c&qd\_src=02020031010000000000&ssl=&ip=123.113.24.207&qd\_vip=0&dis\_src=vrs&qd\_uid=0&qdv=1&qd\_tm=1533397020221 Some parameters can be removed. After removal: http://111.206.23.7/videos/v0/20180720/16/a4/db018716f61beac599012d45774c272d.mp4?key=0276ea66159aaa4db17c1724b53388ca6&dis\_k=2742e7645a8ed2f8dc1aaad964db9072b&dis\_t=1533395921&dis\_dz=CNC-BeiJing&dis\_st=44&qd\_k=52207238abb1ee50c64941d94d60a8be&qd\_ip=7b7118cf&qd\_src=02020031010000000000&qd\_vip=0&qd\_uid=0 Required parameters: key: 0276ea66159aaa4db17c1724b53388ca6 dis_k: 2742e7645a8ed2f8dc1aaad964db9072b dis_t: 1533395921 dis_dz: CNC-BeiJing dis_st: 44 qd_k: 52207238abb1ee50c64941d94d60a8be qd_ip: 7b7118cf qd_src: 02020031010000000000 qd_vip: 0 qd_uid: 0

Youku

Video page address: https://m.youku.com/video/id_XMzc1MDQ5NjcyMA==.html Interface domain: https://ups.youku.com Fields: data->stream->segs Sharded, order not yet clear. Might be difficult to crawl. iframe player (https also works)

<iframe height=498 width=510 src='http://player.youku.com/embed/XMzc1MDQ5NjcyMA==' frameborder=0 'allowfullscreen'></iframe>

The suffix is the page id, looks like it can be done in batch.

bilibili

Video page address: https://www.bilibili.com/video/av28191680 Video address: blob:https://www.bilibili.com/eeb8740a-3671-4405-9ab2-9177204949eb

<iframe src="//player.bilibili.com/player.html?aid=28191680&cid=48730521&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

Actually only need the id after av: https://m.bilibili.com/video/av28191680.html Interface: https://api.bilibili.com/playurl durl->url

爱奇艺

视频网页地址:https://m.iqiyi.com/v\_19rr2cvmus.html 页面会请求一个:https://cache.m.iqiyi.com/ 的接口 里面有一个字段m3u,为视频真实地址。 例:http://netcncallcnc.inter.iqiyi.com/videos/v0/20180720/d9/4f/eddadef77066dc7c960ae952ad83d71a.mp4?key=0035d94084c5cd162a40610306413ea4f&dis\_k=30eb0de0f1341eb0bd743fa691a234f3&dis\_t=1533397020&dis\_dz=CNC-BeiJing&dis\_st=44&src=iqiyi.com&uuid=a0d2dd1-5b65c81c-8c&m=v&qd\_k=9cae95479599021a58e7a683114455a3&sgti=13\_3eprs82wn5ib92y1mp2t6jdg\_1533397019752&qd\_ip=7b7118cf&qd\_p=7b7118cf&dfp=a06680c7961c14486e80f314cd8ffd7f6fa7df798edc359fa022c5d2cfdae1b13c&qd\_src=02020031010000000000&ssl=&ip=123.113.24.207&qd\_vip=0&dis\_src=vrs&qd\_uid=0&qdv=1&qd\_tm=1533397020221 有一些参数是可以去掉的。去掉之后: http://111.206.23.7/videos/v0/20180720/16/a4/db018716f61beac599012d45774c272d.mp4?key=0276ea66159aaa4db17c1724b53388ca6&dis\_k=2742e7645a8ed2f8dc1aaad964db9072b&dis\_t=1533395921&dis\_dz=CNC-BeiJing&dis\_st=44&qd\_k=52207238abb1ee50c64941d94d60a8be&qd\_ip=7b7118cf&qd\_src=02020031010000000000&qd\_vip=0&qd\_uid=0 必需参数: key: 0276ea66159aaa4db17c1724b53388ca6 dis_k: 2742e7645a8ed2f8dc1aaad964db9072b dis_t: 1533395921 dis_dz: CNC-BeiJing dis_st: 44 qd_k: 52207238abb1ee50c64941d94d60a8be qd_ip: 7b7118cf qd_src: 02020031010000000000 qd_vip: 0 qd_uid: 0

优酷

视频网页地址:https://m.youku.com/video/id_XMzc1MDQ5NjcyMA==.html 接口域名:https://ups.youku.com 字段:data->stream->segs 做了分片,顺序还没查清楚。扒起来可能比较困难。 iframe播放器(https也可以)

<iframe height=498 width=510 src='http://player.youku.com/embed/XMzc1MDQ5NjcyMA==' frameborder=0 'allowfullscreen'></iframe>

后面为页面id,看样子可以批量搞定。

bilibili

视频网页地址: https://www.bilibili.com/video/av28191680 视频地址:blob:https://www.bilibili.com/eeb8740a-3671-4405-9ab2-9177204949eb

<iframe src="//player.bilibili.com/player.html?aid=28191680&cid=48730521&page=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"> </iframe>

实际只需要av后面的id即可 https://m.bilibili.com/video/av28191680.html 接口:https://api.bilibili.com/playurl durl->url

项目用遇到了这个问题。 产生问题的原因:调用play之后执行pause。而此时play方法可能还没执行完。 查了一下谷歌这面有解决方案。 https://developers.google.com/web/updates/2017/06/play-request-was-interrupted 第一种解决方案

<video id="video" preload="none" src="https://example.com/file.mp4"></video>

<script>
  // Show loading animation.
  var playPromise = video.play();

  if (playPromise !== undefined) {
    playPromise.then(_ => {
      // Automatic playback started!
      // Show playing UI.
      // We can now safely pause video...
      video.pause();
    })
    .catch(error => {
      // Auto-play was prevented
      // Show paused UI.
    });
  }
</script>

第二种解决方案

<video id="video"></video>
<button id="button"></button>

<script>
  button.addEventListener('click', onButtonClick);

  function onButtonClick() {
    // This will allow us to play video later...
    video.load();
    fetchVideoAndPlay();
  }

  function fetchVideoAndPlay() {
    fetch('https://example.com/file.mp4')
    .then(response => response.blob())
    .then(blob => {
      video.srcObject = blob;
      return video.play();
    })
    .then(_ => {
      // Video playback started ;)
    })
    .catch(e => {
      // Video playback failed ;(
    })
  }
</script>

Encountered this problem in the project. The cause of the problem: pause is executed after calling play. But at this time the play method may not have finished execution. Checked that Google has a solution. https://developers.google.com/web/updates/2017/06/play-request-was-interrupted First solution

<video id="video" preload="none" src="https://example.com/file.mp4"></video>

<script>
  // Show loading animation.
  var playPromise = video.play();

  if (playPromise !== undefined) {
    playPromise.then(_ => {
      // Automatic playback started!
      // Show playing UI.
      // We can now safely pause video...
      video.pause();
    })
    .catch(error => {
      // Auto-play was prevented
      // Show paused UI.
    });
  }
</script>

Second solution

<video id="video"></video>
<button id="button"></button>

<script>
  button.addEventListener('click', onButtonClick);

  function onButtonClick() {
    // This will allow us to play video later...
    video.load();
    fetchVideoAndPlay();
  }

  function fetchVideoAndPlay() {
    fetch('https://example.com/file.mp4')
    .then(response => response.blob())
    .then(blob => {
      video.srcObject = blob;
      return video.play();
    })
    .then(_ => {
      // Video playback started ;)
    })
    .catch(e => {
      // Video playback failed ;(
    })
  }
</script>
0%