|
@@ -0,0 +1,56 @@
|
|
|
+const { BrowserWindow, dialog, shell } = require('electron')
|
|
|
+const cheerio = require('cheerio')
|
|
|
+const pathToFfmpeg = require('ffmpeg-static')
|
|
|
+const {path} = require('ffprobe-static')
|
|
|
+const Ffmpeg = require('fluent-ffmpeg')
|
|
|
+const axios = require('axios')
|
|
|
+axios.defaults.adapter = require("axios/lib/adapters/http");
|
|
|
+ffmpeg = new Ffmpeg()
|
|
|
+
|
|
|
+const ckBtn = document.getElementById('ck')
|
|
|
+ckBtn.onclick = function (e) {
|
|
|
+ console.log(pathToFfmpeg)
|
|
|
+ var source = '/Users/Andy/Documents/work/tickTock/TikTokDownload/Download/post/Milo大人/2022-10-10 15.06.20广东有了秋天的感觉#生活碎片_#秋天_#粤语_#风里有了秋的味道.mp4';
|
|
|
+ ffmpeg.setFfmpegPath(pathToFfmpeg).addInput(source)
|
|
|
+ .output('output/output.flv')
|
|
|
+ .on('end', function () {
|
|
|
+ console.log('Finished processing');
|
|
|
+ })
|
|
|
+ .run();
|
|
|
+}
|
|
|
+
|
|
|
+const dyGetBtn = document.getElementById('dyGet')
|
|
|
+dyGetBtn.onclick = function (e) {
|
|
|
+ console.log(111)
|
|
|
+ let result = axiosGet('https://v.douyin.com/efrHYf2/')
|
|
|
+ // console.log(result);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+const axiosGet = function (url, params) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ axios
|
|
|
+ .get(url, {
|
|
|
+ params,
|
|
|
+ })
|
|
|
+ .then(res => {
|
|
|
+ resolve(res);
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ reject(err);
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|
|
|
+
|
|
|
+const axiosPost = function (url, params) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ axios
|
|
|
+ .post(url, params)
|
|
|
+ .then(res => {
|
|
|
+ resolve(res);
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ reject(err);
|
|
|
+ });
|
|
|
+ });
|
|
|
+}
|