904118851 3 月之前
父節點
當前提交
4096ae499e
共有 7 個文件被更改,包括 100 次插入35 次删除
  1. 1 1
      0_RECEIVE_FACTORY/RECEIVE_FACTORY.js
  2. 二進制
      dump.rdb
  3. 36 0
      logs/combined.log
  4. 36 0
      logs/out.log
  5. 4 3
      src/api/yw/get_yw_account_list.js
  6. 1 12
      src/api/yw/get_yw_recharge_template.js
  7. 22 19
      src/api/yw/switchApp.js

+ 1 - 1
0_RECEIVE_FACTORY/RECEIVE_FACTORY.js

@@ -383,7 +383,7 @@ CMD.get_yw_open_sessid_status = async function(res) {
 
 CMD.get_yw_account_list = async function(res) {
     let data = await require('../src/api/yw/get_yw_account_list').get_yw_account_list()
-    console.log('get_yw_account_list:', data);
+    console.log('get_yw_account_list:', JSON.stringify(data));
     res.writeHead(200, {'Content-Type': 'application/json'});
     res.end(JSON.stringify({ message:"成功!",data:data.data.list,code:10000}));
 }

二進制
dump.rdb


+ 36 - 0
logs/combined.log

@@ -0,0 +1,36 @@
+2025-05-07T10:38:42: 
+2025-05-07T10:38:42: > heiyan@1.0.0 start
+2025-05-07T10:38:42: > node tg_factory_main.js
+2025-05-07T10:38:42: 
+2025-05-07T10:38:44: Connected to Redis
+2025-05-07T10:38:45: data: {
+2025-05-07T10:38:45:   author: '木子',
+2025-05-07T10:38:45:   book_id: '7385111704889216051',
+2025-05-07T10:38:45:   book_name: '绿茶保姆想上位,不想狠狠被打脸',
+2025-05-07T10:38:45:   book_pool: 1,
+2025-05-07T10:38:45:   book_type: 1,
+2025-05-07T10:38:45:   category: '754,125,739,597,776',
+2025-05-07T10:38:45:   category_text: '现实情感,家庭,逆袭,爽文,复仇',
+2025-05-07T10:38:45:   chapter_amount: 1,
+2025-05-07T10:38:45:   chapter_price: 0,
+2025-05-07T10:38:45:   copyright_expiration_time: '',
+2025-05-07T10:38:45:   creation_status: 0,
+2025-05-07T10:38:45:   delivery_status: 1,
+2025-05-07T10:38:45:   free_chapter_count: 0,
+2025-05-07T10:38:45:   genre: 8,
+2025-05-07T10:38:45:   is_derivatived: false,
+2025-05-07T10:38:45:   latest_update_time: '2024-06-27 17:25:11',
+2025-05-07T10:38:45:   length_type: 2,
+2025-05-07T10:38:45:   on_shelf_time: '',
+2025-05-07T10:38:45:   permission_status: 4,
+2025-05-07T10:38:45:   price_changed: false,
+2025-05-07T10:38:45:   short_free_chapter_count: 0,
+2025-05-07T10:38:45:   short_thousand_words_price: 0,
+2025-05-07T10:38:45:   source: '星空文学网',
+2025-05-07T10:38:45:   start_percentage: 40,
+2025-05-07T10:38:45:   thousand_words_price: 0,
+2025-05-07T10:38:45:   thumb_uri: 'novel-static/c219a65907b3f8fa6f6fa9431ab75f13',
+2025-05-07T10:38:45:   thumb_url: 'https://p11-novelsale-sign.yueduwuxianpic.com/novel-static/c219a65907b3f8fa6f6fa9431ab75f13~tplv-t1vlgo34s3-distribmini.image?lk3s=4c55cbb1&x-expires=1749177525&x-signature=kJv7owGQCk2778sTDs4qYMPV1sM%3D',
+2025-05-07T10:38:45:   total_price: 1990,
+2025-05-07T10:38:45:   word_count: 8664
+2025-05-07T10:38:45: }

+ 36 - 0
logs/out.log

@@ -0,0 +1,36 @@
+2025-05-07T10:38:42: 
+2025-05-07T10:38:42: > heiyan@1.0.0 start
+2025-05-07T10:38:42: > node tg_factory_main.js
+2025-05-07T10:38:42: 
+2025-05-07T10:38:44: Connected to Redis
+2025-05-07T10:38:45: data: {
+2025-05-07T10:38:45:   author: '木子',
+2025-05-07T10:38:45:   book_id: '7385111704889216051',
+2025-05-07T10:38:45:   book_name: '绿茶保姆想上位,不想狠狠被打脸',
+2025-05-07T10:38:45:   book_pool: 1,
+2025-05-07T10:38:45:   book_type: 1,
+2025-05-07T10:38:45:   category: '754,125,739,597,776',
+2025-05-07T10:38:45:   category_text: '现实情感,家庭,逆袭,爽文,复仇',
+2025-05-07T10:38:45:   chapter_amount: 1,
+2025-05-07T10:38:45:   chapter_price: 0,
+2025-05-07T10:38:45:   copyright_expiration_time: '',
+2025-05-07T10:38:45:   creation_status: 0,
+2025-05-07T10:38:45:   delivery_status: 1,
+2025-05-07T10:38:45:   free_chapter_count: 0,
+2025-05-07T10:38:45:   genre: 8,
+2025-05-07T10:38:45:   is_derivatived: false,
+2025-05-07T10:38:45:   latest_update_time: '2024-06-27 17:25:11',
+2025-05-07T10:38:45:   length_type: 2,
+2025-05-07T10:38:45:   on_shelf_time: '',
+2025-05-07T10:38:45:   permission_status: 4,
+2025-05-07T10:38:45:   price_changed: false,
+2025-05-07T10:38:45:   short_free_chapter_count: 0,
+2025-05-07T10:38:45:   short_thousand_words_price: 0,
+2025-05-07T10:38:45:   source: '星空文学网',
+2025-05-07T10:38:45:   start_percentage: 40,
+2025-05-07T10:38:45:   thousand_words_price: 0,
+2025-05-07T10:38:45:   thumb_uri: 'novel-static/c219a65907b3f8fa6f6fa9431ab75f13',
+2025-05-07T10:38:45:   thumb_url: 'https://p11-novelsale-sign.yueduwuxianpic.com/novel-static/c219a65907b3f8fa6f6fa9431ab75f13~tplv-t1vlgo34s3-distribmini.image?lk3s=4c55cbb1&x-expires=1749177525&x-signature=kJv7owGQCk2778sTDs4qYMPV1sM%3D',
+2025-05-07T10:38:45:   total_price: 1990,
+2025-05-07T10:38:45:   word_count: 8664
+2025-05-07T10:38:45: }

+ 4 - 3
src/api/yw/get_yw_account_list.js

@@ -8,14 +8,15 @@ const CMD = {}
 CMD.get_yw_account_list = async function() {
     // let res =  await require('./yw_login').yw_login()
     // console.log("res:",res.headers)
+    await require('./switchApp').switchApp(0)
+    await new Promise(resolve => setTimeout(resolve,1000));
     let OPENSESSID = await redis_help.getKeyValue("OPENSESSID")
     let timestamp = helper.getCurrentUnixTimestamp()
     console.log("OPENSESSID:",OPENSESSID)
-    let response =  await fetch("https://open.yuewen.com/api/product/getMainAppidList?coopid=24", {
+    let response =  await fetch("https://open.yuewen.com/api/product/getCoopAppList?coopid=24&page=1&status=0", {
         "headers": {
             "accept": "application/json, text/plain, */*",
-            "cookie": `Hm_lvt_990f9ab9737a266517417cc2949bb3f4=1736394515; csrfToken=NkSA9rxV9WELfeTlA6-LhiYv; OPENSESSID=${OPENSESSID}; yw_open_token=681a43e8b15bc; is_read_notice=681a43e8b15bc; sidebarStatus=0`,
- 
+            "cookie": `Hm_lvt_990f9ab9737a266517417cc2949bb3f4=${timestamp}; csrfToken=NkSA9rxV9WELfeTlA6-LhiYv; OPENSESSID=${OPENSESSID}; yw_open_token=681a43e8b15bc; is_read_notice=681a43e8b15bc; sidebarStatus=0`,
         },
         "body": null,
         "method": "GET"

+ 1 - 12
src/api/yw/get_yw_recharge_template.js

@@ -7,7 +7,7 @@ const helper = require('../../helper');
 const CMD = {}
 
 CMD.get_recharge_template = async function (yw_id) {
-    await require('./switchApp').switchApp(yw_id)
+    let res = await require('./switchApp').switchApp(yw_id)
     try {
         let OPENSESSID = await redis_help.getKeyValue("OPENSESSID")
         let timestamp = helper.getCurrentUnixTimestamp()
@@ -15,18 +15,7 @@ CMD.get_recharge_template = async function (yw_id) {
         const response =  await fetch("https://open.yuewen.com/api/WechatWebsite/PageListChargeSettingTemplates", {
             "headers":{
                 "accept": "application/json, text/plain, */*",
-                "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-                "content-type": "application/json",
-                "priority": "u=1, i",
-                "sec-ch-ua": "\"Chromium\";v=\"134\", \"Not:A-Brand\";v=\"24\", \"Microsoft Edge\";v=\"134\"",
-                "sec-ch-ua-mobile": "?0",
-                "sec-ch-ua-platform": "\"Windows\"",
-                "sec-fetch-dest": "empty",
-                "sec-fetch-mode": "cors",
-                "sec-fetch-site": "same-origin",
                 "cookie": `Hm_lvt_990f9ab9737a266517417cc2949bb3f4=${timestamp}; csrfToken=ffZRRnqo6A4ngGbvAVP_zK5_; OPENSESSID=${OPENSESSID}; yw_open_token=67db7bcd069db; is_read_notice=67db7bcd069db; sidebarStatus=0`,
-                "Referer": "https://open.yuewen.com/new/library",
-                "Referrer-Policy": "strict-origin-when-cross-origin"
             },
             "body": null,
             "method": "GET"

+ 22 - 19
src/api/yw/switchApp.js

@@ -3,6 +3,7 @@ const fetch = require('node-fetch'); // Node.js 18以下版本需要安装 node-
 const config  = require('../../../etc/config.json');
 const redis_help = require('../../use_redis');
 const helper = require('../../helper');
+const tools = require('../../../tools');
 const CMD = {}
 
 CMD.switchApp = async function(yw_id) {
@@ -10,25 +11,27 @@ CMD.switchApp = async function(yw_id) {
     // console.log("res:",res.headers)
     let OPENSESSID = await redis_help.getKeyValue("OPENSESSID")
     let timestamp = helper.getCurrentUnixTimestamp()
-    return await fetch("https://open.yuewen.com/api/account/switchApp", {
-        "headers": {
-          "accept": "application/json, text/plain, */*",
-          "accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
-          "content-type": "application/json",
-          "priority": "u=1, i",
-          "sec-ch-ua": "\"Microsoft Edge\";v=\"131\", \"Chromium\";v=\"131\", \"Not_A Brand\";v=\"24\"",
-          "sec-ch-ua-mobile": "?0",
-          "sec-ch-ua-platform": "\"Windows\"",
-          "sec-fetch-dest": "empty",
-          "sec-fetch-mode": "cors",
-          "sec-fetch-site": "same-origin",
-          "cookie": `Hm_lvt_990f9ab9737a266517417cc2949bb3f4=${timestamp}; csrfToken=ffZRRnqo6A4ngGbvAVP_zK5_; OPENSESSID=${OPENSESSID}; yw_open_token=67db7bcd069db; is_read_notice=67db7bcd069db; sidebarStatus=0`,
-          "Referer": "https://open.yuewen.com/new/library",
-          "Referrer-Policy": "strict-origin-when-cross-origin"
-        },
-        "body": `{\"coopid\":24,\"appid\":${yw_id}}`,
-        "method": "POST"
-      });
+    let coopid = 24
+    if(yw_id==0){
+      coopid = 0
+    }
+    // return await fetch("https://open.yuewen.com/api/account/switchApp", {
+    //     "headers": {
+    //       "accept": "application/json, text/plain, */*",
+    //       "cookie": `Hm_lvt_990f9ab9737a266517417cc2949bb3f4=${timestamp}; csrfToken=ffZRRnqo6A4ngGbvAVP_zK5_; OPENSESSID=${OPENSESSID}; yw_open_token=67db7bcd069db; is_read_notice=67db7bcd069db; sidebarStatus=0`,
+    //     },
+    //     "body": `{\"coopid\":${coopid},\"appid\":${yw_id}}`,
+    //     "method": "POST"
+    // });
+
+    let client = tools.getOneNewClinet( {
+      "cookie": `Hm_lvt_990f9ab9737a266517417cc2949bb3f4=${timestamp}; csrfToken=ffZRRnqo6A4ngGbvAVP_zK5_; OPENSESSID=${OPENSESSID}; yw_open_token=67db7bcd069db; is_read_notice=67db7bcd069db; sidebarStatus=0`,
+    })
+
+    return await client.post("https://open.yuewen.com/api/account/switchApp",{
+      coopid:coopid,
+      appid:yw_id
+    })
 }
 
 module.exports = CMD;