904118851 hai 3 meses
pai
achega
aa1173e712

+ 4 - 3
0_RECEIVE_FACTORY/RECEIVE_FACTORY.js

@@ -382,8 +382,8 @@ CMD.get_yw_open_sessid_status = async function(res) {
     res.end(JSON.stringify({ message:"成功!",data:OPENSESSID,code:10000}));
 }
 
-CMD.get_yw_account_list = async function(res) {
-    let data = await require('../src/api/yw/get_yw_account_list').get_yw_account_list()
+CMD.get_yw_account_list = async function(res,coopid) {
+    let data = await require('../src/api/yw/get_yw_account_list').get_yw_account_list(coopid)
     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}));
@@ -696,7 +696,8 @@ var server = http.createServer(function(req,res){
                     }else if(jsonData['fun']=="get_yw_open_sessid_status"&&jsonData['cmd']=="yw_link"){
                         CMD.get_yw_open_sessid_status(res) 
                     } else if(jsonData['fun']=="get_yw_account_list"&&jsonData['cmd']=="yw_link"){
-                        CMD.get_yw_account_list(res) 
+                        let coopid = jsonData['data']['coopid']
+                        CMD.get_yw_account_list(res,coopid) 
                     } else if(jsonData['fun']=="get_zh_recharge_template"&&jsonData['cmd']=="zh_link"){
                         let app_id = jsonData['data']['app_id']
                         let member_token = jsonData['data']['member_token']

+ 21 - 1
5_CREATE_LINK_FACTORY/yw_create_link.js

@@ -125,7 +125,14 @@ CMD.runTask = async function(t_data,main_info,PlatformInfo,call_back){
         let chapter_info = await require('../src/api/yw/get_book_tg_chapter_id').get_book_tg_chapter_id(t_data.product_id)
         console.log("main_info.yw_id:",main_info.yw_id)
         console.log("chapter_info:",chapter_info)
-        await require('../src/api/yw/switchApp').switchApp(main_info.yw_id)
+        let coopid = 24
+        if(main_info.pay_type==0){
+            coopid = 29
+        }else{
+            coopid = 24
+        }
+
+        await require('../src/api/yw/switchApp').switchApp(main_info.yw_id,coopid)
         let timestamp = helper.getCurrentUnixTimestamp()
         let tg_link_config = JSON.parse(main_info.tg_link_config)
         let chongzhi_id = tg_link_config['chongzhi_id']
@@ -193,6 +200,19 @@ CMD.runTask = async function(t_data,main_info,PlatformInfo,call_back){
             "channel_type": 1,
             "force_style": "1"
         };
+
+        if(main_info.pay_type==0){
+            postData = {
+                "cost": 0,
+                "name": `${promotion_name}_${main_info.id}`,
+                "cbid": t_data.product_id,
+                "ccid": chapter_info.ccid,
+                "page_name": `《${t_data.product_name}》第1章 01`,
+                "backup_book_status": 2,
+                "channel_type": 1,
+                "force_style": "1"
+            };
+        }
         console.log("postData:",postData)
 
         let response = await fetch("https://open.yuewen.com/api/miniappspread/addH5Spread", {

+ 1 - 1
PULL_TIME_DATA/PULL_TIME_DATA.js

@@ -104,7 +104,7 @@ const messageHandler = async (msg) => {
         
         // 转换时间戳为MySQL datetime格式
         const values = data.map(item => [
-            tools.getOriginVideoId(item.contentUrl),
+            tools.getOriginVideoId(item.awemeUrl),
             item.awemeId,
             item.title,
             item.awemeUrl,

BIN=BIN
dump.rdb


BIN=BIN
src/api/hy/qr.gif


BIN=BIN
src/api/hy/qr_resized.gif


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

@@ -4,16 +4,17 @@ const config  = require('../../../etc/config.json');
 const redis_help = require('../../use_redis');
 const helper = require('../../helper');
 const CMD = {}
-
-CMD.get_yw_account_list = async function() {
+//24 = 短篇小说分销
+//29 = 抖音小说分销
+CMD.get_yw_account_list = async function(coopid=24) {
     // let res =  await require('./yw_login').yw_login()
     // console.log("res:",res.headers)
-    await require('./switchApp').switchApp(0)
+    await require('./switchApp').switchApp(0,coopid)
     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/getCoopAppList?coopid=24&page=1&status=0", {
+    let response =  await fetch(`https://open.yuewen.com/api/product/getCoopAppList?coopid=${coopid}&page=1&status=0`, {
         "headers": {
             "accept": "application/json, text/plain, */*",
             "cookie": `Hm_lvt_990f9ab9737a266517417cc2949bb3f4=${timestamp}; csrfToken=NkSA9rxV9WELfeTlA6-LhiYv; OPENSESSID=${OPENSESSID}; yw_open_token=681a43e8b15bc; is_read_notice=681a43e8b15bc; sidebarStatus=0`,

+ 1 - 2
src/api/yw/switchApp.js

@@ -6,12 +6,11 @@ const helper = require('../../helper');
 const tools = require('../../../tools');
 const CMD = {}
 
-CMD.switchApp = async function(yw_id) {
+CMD.switchApp = async function(yw_id,coopid=24) {
     // let res =  await require('./yw_login').yw_login()
     // console.log("res:",res.headers)
     let OPENSESSID = await redis_help.getKeyValue("OPENSESSID")
     let timestamp = helper.getCurrentUnixTimestamp()
-    let coopid = 24
     if(yw_id==0){
       coopid = 0
     }