YTPlayer doesn't finish loading (Error: file not found)


#1

PhantomBot Version: 2.4.2 (Revision: 5c75a7b2)
OS Version: Linux (Ubuntu 16.04.5 LTS)
Java Version: OpenJDK version 1.8.0_191
Browser and Version (for Panel Support): Mozilla Firefox 64.0 (64-bit)
Stock PhantomBot: Yes

Hello there,

I use a fresh install of PhantomBot (only with the german language pack, but it doesn’t matter, I also tried without) and the only module I have enabled (apart from the default ones) is the YTPlayer module.

When I try to launch it (e.g. via the Panel -> Audio -> YouTube Player -> Start YT Player) the new window opens up and then it begins to load and won’t finish that. Even after more than half an hour nothing happens.

From the console output (see below) I recognized that one file (web/ytplayer/js/socket.js) is missing. From other topics on this page I got the tip to get the missing file from the zip archive, but it isn’t in there (otherwise I should have it already anyway, because I’m using a fresh installation).

When I copy the “socket.js” from the subdir util I can’t launch the player anyway, but I get no error in the console.

Thank you for helping!
I’m a beginner, so it can be possible that I missed some basic stuff.

Console log (important line):
[12-28-2018 @ 22:25:16.068 GMT] [ERROR] [handleFile()@HTTPServerCommon.java:572] HTTP Server: handleFile(): ./web/ytplayer/js/socket.js (No such file or directory)

Whole session log: Pastebin Link


#2

Okay, like always, a short time after posting this request I got the player working. :smiley:

I copied the files from the util folder in the ytplayer/js directory and then I added my own API key.

But can somebody explain why the files are not correct when I download the zip file?


#3

Not sure why you’d be missing files, but way back when I first started using PhantomBot, I had issues with the YT player getting stuck in a loading page and what resolved it was loading a playlist using the !playlist command. I don’t know why it worked, but I haven’t had issues ever since. Maybe this little trick might fix your hiccup, too? Though I can’t say for certain.


#4

That is odd, this is from the 2.4.2 download:

[morpheus] /home/illusion/check/PhantomBot-2.4.2/web
illusion% find . -name socket.js
./ytplayer/js/util/socket.js
[morpheus] /home/illusion/check/PhantomBot-2.4.2/web
illusion% cd ytplayer/
[morpheus] /home/illusion/check/PhantomBot-2.4.2/web/ytplayer
illusion% grep -R socket.js *
index.html:    <script src="/ytplayer/js/util/socket.js"></script>
js/index.js: * For more functions under the "player" object, take a look at the socket.js script.

The index.html shows the file is js/util/socket.js. The file was moved in Feburary 2018:

commit a32fb998e5b9b87e1706e03a893f413e70962474
Author: ScaniaTV <[email protected]>
Date:   Mon Feb 5 21:35:03 2018 -0400

    - Added settings modal

    **style.css:**
    - Added style for dropdowns.

    **index.js:**
    - Moved over the modal function over to helpers.js.

    **helpers.js:**
    - This script has a bunch of helper functions, though for now it's
    mostly modal functions. All helper functions should be in this.

   >>>>>  **socket.js:**
   >>>>> - Moved socket to the util folder.

Unfortunately, I am unable to reproduce from the 2.4.2 download.


#5

I wonder if you still had the German Translation file in place? Looking at a file from what I guess is the GitHub archive, definitely referring to the file in the old location. If you are getting it elsewhere, let me know so I can check that archive.

https://github.com/X00LA/PhantomBot-German-Translation/blob/master/web/ytplayer/index.html


#6

I got the files from that link and obviously it loads still the file from the old location. So changing it in the index.html simply solves the problem.