Browse Source

增加pm2并修改保存路径

LiuLiu 2 years ago
parent
commit
2dc5139ff8
2 changed files with 16 additions and 2 deletions
  1. 2 2
      core/recorder.py
  2. 14 0
      pm2.config.json

+ 2 - 2
core/recorder.py

@@ -30,10 +30,10 @@ class Recorder:
             'qn_desc': current_qn_desc,
             'datetime': datetime.now().isoformat()
         })
-        f_handler=open(outputName+'.log', 'w') if log else asyncio.subprocess.PIPE
+        f_handler=open("./logs/"+outputName+'.log', 'w') if log else asyncio.subprocess.PIPE
         self.ff = ffmpy3.FFmpeg(
             inputs={url:" -v debug"},
-            outputs={outputName+".flv":"-c copy -y"}
+            outputs={"./videos/"+outputName+".flv":"-c copy -y"}
         )
         self.process = self.ff.run_async(stdout=f_handler, stderr=f_handler)
         print(self.ff.cmd)

+ 14 - 0
pm2.config.json

@@ -0,0 +1,14 @@
+{
+    "name": "bilibiliAutoRecorder",
+    "script": "python3",
+    "args": "__main__.py",
+    "cwd": "./",
+    "watch": [],
+    "ignore_watch": [
+      "videos",
+      "logs"
+    ],
+    "watch_options": {
+      "followSymlinks": false
+    }
+  }