insanity54 / futureporn

Unofficial ProjektMelody Chaturbate VOD Archive. For Adults Only.
https://futureporn.net
26 stars 3 forks source link

futureporn-scout crash when stream start #211

Closed insanity54 closed 1 year ago

insanity54 commented 1 year ago
debug: 🟢🟢🟢 [STREAM START] {"name":"room:status:NKZGLNV:1","id":"xXo8HERex5:0:0","encoding":null,"data":{"tid":"16866769033:86576","ts":1686676903.3435848,"status":"public","message":"","hash":"","method":"lazy","pub_ts":1686676903.355916}} {"service":"futureporn/scout","timestamp":"2023-06-13T17:21:43.443Z"}
appContext.cb.getPlaylistUrl is defined and it is async (appContext, roomName) => {
  const operation = async () => {
    const { stdout: playlistUrl } = await execa('yt-dlp', ['-g', `https://chaturbate.com/${roomName}`]);
    return playlistUrl.trim();
  };
  return await pRetry(operation, { 
    retries: 3, 
    minTimeout: 1000,
    onFailedAttempt(e) {
      appContext.logger.log({ level: 'debug', message: `error getting playlist url during attempt ${e.attemptNumber}. ${e.retriesLeft} retries remaining.` })
    }
  });
}
debug: Received room:status:<roomId>:0 {"service":"futureporn/scout","timestamp":"2023-06-13T17:21:43.472Z"}
debug: {
  "name": "room:status:NKZGLNV:1",
  "id": "xXo8HERex5:0:0",
  "encoding": null,
  "data": {
    "tid": "16866769033:86576",
    "ts": 1686676903.3435848,
    "status": "public",
    "message": "",
    "hash": "",
    "method": "lazy",
    "pub_ts": 1686676903.355916
  }
} {"service":"futureporn/scout","timestamp":"2023-06-13T17:21:43.472Z"}
debug: error getting playlist url during attempt 1. 3 retries remaining. {"service":"futureporn/scout","timestamp":"2023-06-13T17:21:44.616Z"}
debug: error getting playlist url during attempt 2. 2 retries remaining. {"service":"futureporn/scout","timestamp":"2023-06-13T17:21:46.590Z"}
debug: error getting playlist url during attempt 3. 1 retries remaining. {"service":"futureporn/scout","timestamp":"2023-06-13T17:21:49.774Z"}
debug: error getting playlist url during attempt 4. 0 retries remaining. {"service":"futureporn/scout","timestamp":"2023-06-13T17:21:54.962Z"}
file:///home/chris/Documents/futureporn-scout/node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/error.js:59
        error = new Error(message);
                ^

Error: Command failed with exit code 1: yt-dlp -g https://chaturbate.com/jeangreybianca
WARNING: [Chaturbate] Failed to download m3u8 information: HTTP Error 403: Forbidden
ERROR: [Chaturbate] jeangreybianca: No video formats found!; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U
    at makeError (file:///home/chris/Documents/futureporn-scout/node_modules/.pnpm/execa@7.1.1/node_modules/execa/lib/error.js:59:11)
    at handlePromise (file:///home/chris/Documents/futureporn-scout/node_modules/.pnpm/execa@7.1.1/node_modules/execa/index.js:124:26)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async operation (file:///home/chris/Documents/futureporn-scout/src/cb.js:32:37)
    at async RetryOperation._fn (file:///home/chris/Documents/futureporn-scout/node_modules/.pnpm/p-retry@5.1.2/node_modules/p-retry/index.js:55:13) {
  shortMessage: 'Command failed with exit code 1: yt-dlp -g https://chaturbate.com/jeangreybianca',
  command: 'yt-dlp -g https://chaturbate.com/jeangreybianca',
  escapedCommand: 'yt-dlp -g "https://chaturbate.com/jeangreybianca"',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'WARNING: [Chaturbate] Failed to download m3u8 information: HTTP Error 403: Forbidden\n' +
    'ERROR: [Chaturbate] jeangreybianca: No video formats found!; please report this issue on  https://github.com/yt-dlp/yt-dlp/issues?q= , filling out the appropriate issue template. Confirm you are on the latest version using  yt-dlp -U',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false,
  attemptNumber: 4,
  retriesLeft: 0
}

Node.js v18.15.0
 ELIFECYCLE  Command failed with exit code 1.

my yt-dlp is up to date (stable@2023.03.04)

insanity54 commented 1 year ago

blocking for #3

insanity54 commented 1 year ago

Occurred again, so definitely not a fluke. Apparently yt-dlp -g https://chaturbate.com/projektmelody is giving HTTP 403 errors, even though I can run the command manually and it runs fine.

insanity54 commented 1 year ago

Oh! I think I figured out the issue. Hilariously, I'm running yt-dlp TOO SOON! Immediately run following an Ably event, yt-dlp will throw a 403 because the stream is not up yet!

insanity54 commented 1 year ago

Ok so the fix I implemented is to increase retries from 3 to 6, and increase minTimeout from 1000 to 2000. This uses pRetry which has an exponential backoff.

insanity54 commented 1 year ago

fix is good