fix: 限制旧内存部分的最大内存大小为128M,增加测试用例

This commit is contained in:
lyz05
2022-11-08 16:22:21 +08:00
parent 872058742f
commit 02eb6d6821
5 changed files with 9 additions and 11 deletions

View File

@@ -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

View File

@@ -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) => {

View File

@@ -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) => {

View File

@@ -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"