async def startScript(): global theScriptProcess myOBScall(requests.ResumeRecording()) path = os.path.join( os.path.dirname(os.path.realpath(__file__)), "autoPauseOrResumeTheOBSrecording.py", ) if not t.is_running("autoPauseOrResumeTheOBSrecording.py"): theScriptProcess = t.run_program(f"python3 '{path}'")
async def resume(self, ctx: Context): """ Отменяет перерыв %%resume """ if not self.bot.check_sender(ctx, 'iarspider'): asyncio.ensure_future( ctx.send('/timeout ' + ctx.author.name + ' 1')) return # self.logger.info("get_player()") # self.get_player() # self.logger.info("player_play_pause()") # self.player_play_pause() if self.ws is not None: if self.vr: self.switch_to('VR Game') self.ws.call( obsws_requests.SetMute(self.aud_sources.getMic2(), False)) else: self.logger.info("switch to game") self.switch_to('Game') self.logger.info("unmute mic") self.ws.call( obsws_requests.SetMute(self.aud_sources.getMic1(), False)) self.ws.call(obsws_requests.SetMute(True, 'Радио')) self.ws.call(obsws_requests.ResumeRecording()) try: self.logger.info("get stream") res = await self.bot.my_get_stream(self.bot.user_id) self.logger.info("got stream") viewers = numeral.get_plural(res['viewer_count'], ('зритель', 'зрителя', 'зрителей')) self.logger.info("prepared message") asyncio.ensure_future( ctx.send('Перепись населения завершена успешно! ' f'Население стрима составляет {viewers}')) self.logger.info("sent message") except (KeyError, TypeError) as exc: asyncio.ensure_future(ctx.send('Перепись населения не удалась :(')) self.logger.error(str(exc))
def ResumeRecording(self): #untested try: self.ws.call(requests.ResumeRecording()) except Exception as e: print(e)
import logging logging.basicConfig(level=logging.INFO) sys.path.append('../') from obswebsocket import obsws, requests # noqa: E402 host = "localhost" port = 4444 password = "******" ws = obsws(host, port, password) ws.connect() try: scenes = ws.call(requests.GetSceneList()) for s in scenes.getScenes(): name = s['name'] print("\n" + name + "\n") ws.call(requests.PauseRecording()) time.sleep(2) ws.call(requests.ResumeRecording()) print("End of list") except KeyboardInterrupt: pass ws.disconnect()
async def resume(): myOBScall(requests.ResumeRecording()) return {"message": "done"}
def Recording_Resume(self, *args, **kwargs): try: self.ws.call(requests.ResumeRecording()) PrintWithTime(f"Resumed recording") except Exception as e: PrintWithTime(f"Couldn't resume recording. Error : {e}")