Instructions on how to get replay links/logs of duels without having to wait for the duel itself to finish first

If you have a suggestion for the site, create a topic here and telll us about it
Christen57
User avatar
Posts: 2033
Joined: Sun May 07, 2017 10:37 pm
Reputation: 182
Location: New York, United States of America

Instructions on how to get replay links/logs of duels without having to wait for the duel itself to finish first

Post #1 by Christen57 » Sat Oct 03, 2020 6:32 pm

Currently on duelingbook, at the time of writing this, when dueling another player or spectating a duel or match between players, you have to wait until the entire duel/match is over before you can get the replay link and logs of that duel/match. Judges already have the ability to acquire links to replays of duels without waiting for those duels themselves to finish, but regular users couldn't do that, at least not until now, that is.

For you see, after playing around some more with javascript, I have discovered a way to acquire the replay links and logs of duels/matches that you are currently either participating in or spectating, without having to wait for that duel or match itself to finish.

This is useful for at least 2 reasons. Firstly, if you are spectating a duel/match, and you want to leave, but you want to acquire the replay of that duel/match first before you go, you would normally have to just sit through the entire duel/match before you can acquire the replay link and logs of that duel/match and then go, but now, you can just grab the replay link before hand, go, and then watch the replay later after the duel/match itself finishes, so you aren't sitting through an entire duel/match just to get a replay.

Secondly, being able to acquire replay links early, without having to sit through the entire duel/match first, means that you will be able to access the logs of that duel/match while the duel/match is still going on, and see everything that happened so far, prior to you joining that duel/match as a spectator, since all duelingbook replay links begin with https://www.duelingbook.com/replay?id= followed by the replay's unique identification number, so you can just replace "replay" with "log" so it becomes https://www.duelingbook.com/log?id= followed by said identification number.

Now here is what you need to do in order to get replay links/logs of duels/matches without having to wait for the duel/match itself to finish first.

First, make sure javascript is enabled/allowed on duelingbook. Some browsers may have this enabled by default, while others require you to manually enable/allow it in the settings and may also require you to refresh/reload your duelingbook page for the changes to take effect.

Image

Next, create a new bookmark on your browser and name it whatever you want. For this demonstration, I will be naming the bookmark "replay toggler".

Image

In the box that says "URL," copy and paste this entire line of code:

javascript:var viewer = document.evaluate('/html/body/div[2]/div[4]/div[45]/div[22]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;var vev = document.getElementById("draw_btn");if(vev.style.display!="inline"||vev.value!="View Replay"){vev.style.display="inline";vev.value="View Replay";viewer.innerHTML="View Replay"}else if(vev.style.display=="inline"&&vev.value=="View Replay"){vev.value="Offer Draw";viewer.innerHTML="Offer Draw"};undefined;

After you do that, click the Save button to save your bookmark.

Image

Now all you have to do is go on duelingbook, and spectate any duel or match.

Image

Then, click on your newly created bookmark. Since I named mine "replay toggler" I will click on replay toggler.

If all steps were followed correctly, the option to view the replay should appear.

Image

Note that the duel/match itself still has to finish before you can actually watch the replay or you will just be told that the duel itself "is still in progress," but you can still replace "duelingbook.com?replayid=" in your replay URL with "duelingbook.com?logid=" so you can still view the logs as a spectator in another tab, while the duel is happening in the original tab, as long as you refresh that log page on that tab it's on to stay up to date with what happened, but now at least you don't have to wait until the entire duel/match itself is over before you can get the replay link.

Image

That's all you need to do. Now you can get replay links, and view a page of entire logs of duels/matches that you are spectating, without having to wait for the duel/match itself to finish. This code has been thoroughly tested on both Google Chrome and Mozilla Firefox, so there shouldn't be any issues, at least not on those 2 common browsers people use for duelingbook.

Christen57
User avatar
Posts: 2033
Joined: Sun May 07, 2017 10:37 pm
Reputation: 182
Location: New York, United States of America

Post #2 by Christen57 » Thu Oct 29, 2020 9:32 pm

I updated my code so that when you are on the "http://duelingbook.com/replay?id=" page and you click the bookmark, it automatically brings up the log page for that duel, so you don't have to manually replace "replay" with "log" in the URL every time. Here is the updated code.

Code: Select all

javascript:if(document.location.href.slice(0,38)=="https://www.duelingbook.com/replay?id="){open("https://www.duelingbook.com/log?id="+document.location.href.slice(38))};var viewer = document.evaluate('/html/body/div[2]/div[4]/div[45]/div[22]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;var vev = document.getElementById("draw_btn");if(vev.style.display!="inline"||vev.value!="View Replay"){vev.style.display="inline";vev.value="View Replay";viewer.innerHTML="View Replay"}else if(vev.style.display=="inline"&&vev.value=="View Replay"){vev.value="Offer Draw";viewer.innerHTML="Offer Draw"};undefined;

Christen57
User avatar
Posts: 2033
Joined: Sun May 07, 2017 10:37 pm
Reputation: 182
Location: New York, United States of America

Post #3 by Christen57 » Fri Jan 08, 2021 2:24 pm

I had to update my code since it stopped working properly for some reason, meaning it would still make the button appear but it wouldn't change "Offer Draw" to "Replay" and vice versa, on the button. The only change I had to make apparently was change "div[45]" to "div[46]" and it worked.

Code: Select all

javascript:if(document.location.href.slice(0,38)=="https://www.duelingbook.com/replay?id="){open("https://www.duelingbook.com/log?id="+document.location.href.slice(38))};var viewer = document.evaluate('/html/body/div[2]/div[4]/div[46]/div[22]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;var vev = document.getElementById("draw_btn");if(vev.style.display!="inline"||vev.value!="View Replay"){vev.style.display="inline";vev.value="View Replay";viewer.innerHTML="View Replay"}else if(vev.style.display=="inline"&&vev.value=="View Replay"){vev.value="Offer Draw";viewer.innerHTML="Offer Draw"};undefined;

soysandwich2
User avatar
Posts: 1
Joined: Sat Sep 19, 2020 2:33 am
Reputation: 0

Post #4 by soysandwich2 » Fri Jan 08, 2021 6:20 pm

This is very helpful, thanks for this post man

Lil Oldman
User avatar
Posts: 1733
Joined: Sun Mar 04, 2018 11:23 pm
Reputation: 178
Location: Toontown
Mood:

Post #5 by Lil Oldman » Fri Jan 08, 2021 6:24 pm

These are some Cosmic Mind level threads.
"Complacency? How rude. I live the stifling life of a high school student in our problematic modern society."
Help I cannot remove this music from my head
https://youtu.be/ZuXI7qcNsHQ
Will try reviewing custom cards if they look interesting.

atena
User avatar
Posts: 8
Joined: Wed Apr 08, 2020 5:18 am
Reputation: 0

Post #6 by atena » Fri Jan 08, 2021 7:45 pm

I think that's how the YugiTubers get the replays

Christen57
User avatar
Posts: 2033
Joined: Sun May 07, 2017 10:37 pm
Reputation: 182
Location: New York, United States of America

Post #7 by Christen57 » Sat Mar 20, 2021 5:22 pm

I updated my code so it still lets you get the replay links and logs of duels without having to wait for the duel itself to finish first, but now the code works differently than before.

While participating in a duel/match or spectating one, Instead of clicking the bookmark to bring up the View Replay button then clicking the View Replay button to view the replay, you now have to click the bookmark, then you will see 2 options: An "OK" option and a "Cancel" option.

Clicking the OK option takes you to the replay of that duel, while clicking the Cancel option takes you to the log of that duel.

Image

Also, with the updated code, if you now click the bookmark while viewing replays, you will be taken to the logs, and if you now click the bookmark while viewing logs, you will be taken to the replay.

Here is the updated code:

Code: Select all

javascript:if(document.location.href.slice(0,38)=="https://www.duelingbook.com/replay?id="){open("https://www.duelingbook.com/log?id="+document.location.href.slice(38))} else if(document.location.href.slice(0,35)=="https://www.duelingbook.com/log?id="){open("https://www.duelingbook.com/replay?id="+document.location.href.slice(35))} else if(duelId >= 0){var vi = confirm("Click OK for Replay. Click Cancel for Logs.");if(vi){open("https://www.duelingbook.com/replay?id="+duelId)} else{open("https://www.duelingbook.com/log?id="+duelId)}};undefined;


Return to “Suggestions”

Who is online

Users browsing this forum: No registered users and 247 guests