mirror of
https://github.com/lyz05/danmaku.git
synced 2026-03-20 03:45:15 +08:00
fix: 限制旧内存部分的最大内存大小为128M,增加测试用例
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
const axios = require('axios');
|
||||
const convert = require('xml-js');
|
||||
const pako = require('pako');
|
||||
const cheerio = require('cheerio');
|
||||
const {time_to_second, make_response, content_template} = require('./utils');
|
||||
|
||||
|
||||
//资源消耗大 256M内存扛不住
|
||||
function Iqiyi() {
|
||||
this.name = '爱奇艺'
|
||||
this.domain = 'iqiyi.com'
|
||||
@@ -57,7 +56,7 @@ function Iqiyi() {
|
||||
for (const data of datas) {
|
||||
const xml = pako.inflate(data, {to: 'string'})
|
||||
const $ = cheerio.load(xml, {xmlMode: true});
|
||||
$('bulletInfo').each(function (i, elem) {
|
||||
$('bulletInfo').each(function () {
|
||||
var content = JSON.parse(JSON.stringify(content_template));
|
||||
content.timepoint = $(this).find('showTime').text()//showTime
|
||||
content.color = parseInt($(this).find('color').text(), 16)//color
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
const urlmodule = require('url');
|
||||
const axios = require('axios');
|
||||
const convert = require('xml-js');
|
||||
const {time_to_second, make_response, content_template} = require('./utils');
|
||||
|
||||
function Mgtv() {
|
||||
this.name = '芒果TV'
|
||||
this.domain = 'mgtv.com'
|
||||
this.example_urls = [
|
||||
'https://www.mgtv.com/b/336727/8087768.html'
|
||||
'https://www.mgtv.com/b/336727/8087768.html',
|
||||
'https://www.mgtv.com/b/459529/17730031.html' //api lens 90
|
||||
];
|
||||
|
||||
this.resolve = async (url) => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
const urlmodule = require('url');
|
||||
const axios = require('axios');
|
||||
const convert = require('xml-js');
|
||||
const cheerio = require("cheerio");
|
||||
const {make_response, content_template} = require('./utils');
|
||||
|
||||
@@ -9,7 +8,8 @@ function Tencentvideo() {
|
||||
this.name = '腾讯视频'
|
||||
this.domain = 'v.qq.com'
|
||||
this.example_urls = [
|
||||
'https://v.qq.com/x/cover/mzc002003pn34qk/u3319i5s3jt.html'
|
||||
'https://v.qq.com/x/cover/mzc002003pn34qk/u3319i5s3jt.html',
|
||||
'https://v.qq.com/x/cover/53q0eh78q97e4d1/x00174aq5no.html'//api lens 50
|
||||
];
|
||||
|
||||
this.resolve = async (url) => {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
const urlmodule = require('url');
|
||||
const axios = require('axios');
|
||||
const convert = require('xml-js');
|
||||
const cookie = require('cookie');
|
||||
const crypto = require('crypto');
|
||||
const {make_response, content_template} = require('./utils');
|
||||
|
||||
//资源消耗大 256M内存扛不住
|
||||
function Youku() {
|
||||
this.name = '优酷'
|
||||
this.domain = 'v.youku.com'
|
||||
@@ -48,7 +48,6 @@ function Youku() {
|
||||
const q = urlmodule.parse(url, true);
|
||||
const path = q.pathname.split('/');
|
||||
const video_id = path.slice(-1)[0].split('.')[0].slice(3);
|
||||
const duration = 0
|
||||
if (video_id) {
|
||||
// "?client_id=53e6cc67237fc59a&package=com.huawei.hwvplayer.youku&ext=show&video_id={}"
|
||||
api_url = "https://openapi.youku.com/v2/videos/show.json"
|
||||
|
||||
Reference in New Issue
Block a user