intenzi / showdownreplaydownloader Goto Github PK
View Code? Open in Web Editor NEWAutomate recording Pokémon Showdown replays as a video
License: MIT License
Automate recording Pokémon Showdown replays as a video
License: MIT License
The client of showdown has made breaking design changes for replays as it was completely rewritten.
All the features it used to provide still exist (themes, speed, etc.) along with an additional feature to toggle off audio completely in-replay itself. They now have a different html structure and thus aren't being located.
Along with it, the replay cropping is no longer capturing the replay video and needs a fix. This has happened as the css added to the website via pfx-panel
class is non-functional as the class no longer exists. The css logic needs to be changed to be able to properly shift the battle replay to the top left along with the battle text.
I ran npm install
in my git clone of this repo(my /home/zuki/src/ShowdownReplayDownloader
dir) then
node download.js --nochat --noaudio -l https://replay.pokemonshowdown.com/gen9nationaldexubers-1962139555
the output of this command is at the bottom of this issue.
I did get a output replay file as the log suggests, a compressed version of the video is bellow it has black bars embeded into the video at the top and bottom a little bit of the chat embeded and and little bit bellow that should have been cropped out.
The audio of the replay was played when recording as well although I don't know if thats how it works on all systems.
Opened replay SacredStar3 vs zooki18 (gen9nationaldexubers)
Saving Replay.. (this may take a while.. preferably not more than 1.28 minutes)
[*estimates are calced at normal speed*]
Finished recording https://replay.pokemonshowdown.com/gen9nationaldexubers-1962139555
Recording Saved!
Location -> replays/replay-4k7ublc0ztumbi.webm
Thankyou for utilising Showdown Replay Downloader!!
/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:138
this._reject(callback, new Errors_js_1.TargetCloseError('Target closed'));
^
TargetCloseError: Protocol error (Runtime.callFunctionOn): Target closed
at CallbackRegistry.clear (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:138:36)
at CDPSessionImpl._onClosed (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:451:25)
at Connection.onMessage (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:248:25)
at WebSocket.<anonymous> (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NodeWebSocketTransport.js:52:32)
at callListener (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/node_modules/ws/lib/event-target.js:209:9)
at WebSocket.emit (node:events:514:28)
at Receiver.receiverOnMessage (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/node_modules/ws/lib/websocket.js:1184:20)
at Receiver.emit (node:events:514:28)
at Receiver.dataMessage (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/node_modules/ws/lib/receiver.js:541:14)
Node.js v20.8.0
here is the output video and log.
--Booting Downloader--
Opened replay undefined vs undefined ([Gen 9] NatDex Draft)
Saving Replay.. (this may take a while.. preferably not more than 2.10 minutes)
[*estimates are calced at normal speed*]
Finished recording https://replay.pokemonshowdown.com/gen9natdexdraft-2067600362
Recording Saved!
Location -> replays/replay-lm8kylqhb5o8mb.webm
Thankyou for utilising Showdown Replay Downloader!!
/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:138
this._reject(callback, new Errors_js_1.TargetCloseError('Target closed'));
^
TargetCloseError: Protocol error (Runtime.callFunctionOn): Target closed
at CallbackRegistry.clear (/home/zuki/src/ShowdownReplayDownload
er/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:138:36)
at CDPSessionImpl._onClosed (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:451:25)
at Connection.onMessage (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:248:25)
at WebSocket.<anonymous> (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/lib/cjs/puppeteer/common/NodeWebSocketTransport.js:52:32)
at callListener (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/node_modules/ws/lib/event-target.js:290:14)
at WebSocket.onMessage (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/node_modules/ws/lib/event-target.js:209:9)
at WebSocket.emit (node:events:519:28)
at Receiver.receiverOnMessage (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/node_modules/ws/lib/websocket.js:1184:20)
at Receiver.emit (node:events:519:28)
at Receiver.dataMessage (/home/zuki/src/ShowdownReplayDownloader/node_modules/puppeteer-core/node_modules/ws/lib/receiver.js:541:14)
Node.js v21.6.2
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.