Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canary issue? #38

Closed
AlexFlipnote opened this issue Dec 17, 2017 · 22 comments
Closed

Canary issue? #38

AlexFlipnote opened this issue Dec 17, 2017 · 22 comments

Comments

@AlexFlipnote
Copy link
Contributor

So I have tried to install BeautifulDiscord from the Canary branch, however it stopped to work today at 17. September 2017. Here's an image of the error it output
Image

I have tested from both C:\ and G:\ (Just to make sure it's not different partition issue, but the same error displays regardless.

Here's an image of the folder it searches, noticed that discord_desktop_core is not located here. In case of wonder, I have tried to reinstall Discord Canary to check.
Image2

Thanks in advance
-- AlexFlipnote

@shikhir-arora
Copy link

Can confirm the same issue on OS X. Looks like Discord changed where the app.asar is.

~ beautifuldiscord --css theme.css
Found Discord Canary under /Applications/Discord Canary.app/Contents/MacOS
WARNING: app.asar not found

Done!

You may now edit your /Users/shikhirarora/theme.css file,
which will be reloaded whenever it's saved.

Relaunching Discord now...

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 18, 2017

The change was reverted so you shouldn't use that branch.

@Rapptz Rapptz closed this as completed Dec 18, 2017
@shikhir-arora
Copy link

Hey @Rapptz -- appears to have come back as of the just latest update on canary.

[BUILD INFO] Release Channel: canary, Build Number: 8829, Version Hash: dc95517d7e4f4754019a1be9446c540829f37f4d 2017-12-18 19:09:32.517

They just pushed another canary update and it seems to not work on macOS. I've tried reinstalling and using both the canary and master (regular) branch of BeautifulDiscord.

~ python3 -m beautifuldiscord --css theme.css 
0: Found Discord PTB
1: Found Discord Canary
Discord executable to use (number): 1
WARNING: app.asar not found
Traceback (most recent call last):
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/local/Cellar/python3/3.6.2/Frameworks/Python.framework/Versions/3.6/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.6/site-packages/beautifuldiscord/__main__.py", line 3, in <module>
    main()
  File "/usr/local/lib/python3.6/site-packages/beautifuldiscord/app.py", line 233, in main
    with open('./app/index.js', 'r', encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: './app/index.js'
~ beautifuldiscord --css theme.css
0: Found Discord Canary
1: Found Discord PTB
Discord executable to use (number): 0
Couldn't copy file ./node_modules/.bin/har-validator, no extracted directory
Couldn't copy file ./node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/.bin/mkdirp, no extracted directory
Couldn't copy file ./node_modules/.bin/rimraf, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-conv, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-sign, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-verify, no extracted directory
Couldn't copy file ./node_modules/.bin/uuid, no extracted directory
Couldn't copy file ./node_modules/create-react-class/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/fbjs/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-conv, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-sign, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-verify, no extracted directory
Couldn't copy file ./node_modules/prop-types/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/react/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/react-dom/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/request/node_modules/.bin/har-validator, no extracted directory
Couldn't copy file ./node_modules/request/node_modules/.bin/uuid, no extracted directory
Traceback (most recent call last):
  File "/usr/local/bin/beautifuldiscord", line 11, in <module>
    load_entry_point('BeautifulDiscord==0.1.0', 'console_scripts', 'beautifuldiscord')()
  File "/usr/local/lib/python3.6/site-packages/beautifuldiscord/app.py", line 233, in main
    with open('./app/index.js', 'r', encoding='utf-8') as f:
FileNotFoundError: [Errno 2] No such file or directory: './app/index.js'

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 19, 2017

That's not the canary branch (I no longer open any index.js file there). Make sure you're using the right branch.

@shikhir-arora
Copy link

Thanks for fixing it so fast/pointing that out, forgot to pull the right branch -- my mistake.
python3 -m pip install -U https://github.com/leovoel/BeautifulDiscord/archive/canary.zip worked fine. Appreciate the help.

@simoniz0r
Copy link

Seems like we hopefully have a more permanent change this time. The folders that were in the desktop_core_app folder in the config directory have been moved into core.asar. If core.asar is extracted into the discord_desktop_core directory, we get all of the same folders we had from last update and are able to apply the same changes. Move core.asar to a backup location, and everything works pretty similarly to the way it did before all of these changes. Slightly more convenient now as it won't require elevated permissions to modify.

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 20, 2017

Not exactly, since the require call is quite explicit with require('./core.asar').

@simoniz0r
Copy link

simoniz0r commented Dec 20, 2017

I noticed that also and expected this to not work, but I had no troubles making the above modifications. I extracted core.asar to desktop_core_app, added the necessary variables and function to hotload CSS, and moved core.asar to core.asar.bak. After doing that, CSS hotloading works as expected.

Will probably need a revert function of some sort like before, but I'm not sure how this folder will be handled in updates. Previously, all of these folders were completely cleared out in the config dir on each server side update, so hopefully that continues to happen. Otherwise, there could potentially be errors on each server side update.

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 20, 2017

image

Like I said, not quite.

@simoniz0r
Copy link

simoniz0r commented Dec 20, 2017

When did you get that error? I've been using the client with the above modifications for a couple of hours now with no errors. Might just be a thing that works on Linux?

FWIW, I tried connecting to VC, restarting the app multiple times, etc and everything seems to be working as expected.

:EDIT: Just thinking maybe you didn't extract core.asar in the way it expects? Here's a screenshot of my discord_desktop_core folder to show how I've extracted it.

image

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 20, 2017

Doesn't matter much -- I've already fixed it by just repacking the asar file when I finish modifying it.

I've also added preliminary Linux support based on what people have told me. If it works please let me know (or if it stops working) @simoniz0r

@simoniz0r
Copy link

@Rapptz Doesn't seem to be able to find the directory:

Found DiscordCanary under /opt/discord-canary
Traceback (most recent call last):
  File "./.local/bin/beautifuldiscord", line 11, in <module>
    load_entry_point('BeautifulDiscord==0.1.0', 'console_scripts', 'beautifuldiscord')()
  File "/home/simonizor/.local/lib/python3.6/site-packages/beautifuldiscord/app.py", line 211, in main
    os.chdir(discord.script_path)
  File "/home/simonizor/.local/lib/python3.6/site-packages/beautifuldiscord/app.py", line 92, in script_path
    raise RuntimeError('Could not find discord application version under "{}".'.format(config))
RuntimeError: Could not find discord application version under "/home/simonizor/.config/discordcanary".

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 20, 2017

You mind giving me the results of os.listdir of that path?

@simoniz0r
Copy link

simoniz0r commented Dec 20, 2017

[REDACTED]
See proper output below

@ghost
Copy link

ghost commented Dec 20, 2017

~ ➜  python                                                           
Python 3.6.3 (default, Oct 24 2017, 14:48:20) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.listdir('/home/sans/.config/discordcanary/')
['blob_storage', 'discord-canary-2.png', 'QuotaManager', 'discord-canary-8.png', 'modules.log', 'discord-canary-6.png', 'Local Storage', 'discord-canary-10.png', 'Cache', 'discord-canary-9.png', 'tray-deafened.png', 'IndexedDB', '0.0.41', 'discord-canary-1.png', 'Cookies-journal', 'queued_analytics_events.json', 'discord-canary-5.png', 'tray.png', 'tray-speaking.png', 'QuotaManager-journal', 'settings.json', 'tray-connected.png', 'Preferences', 'tray-unread.png', 'discord-canary-4.png', 'Cookies', 'cssInjection.js', 'discord-canary-7.png', 'databases', 'discord-canary-0.png', 'tray-muted.png', 'discord-canary-11.png', 'discord-canary-3.png', 'GPUCache']

@shikhir-arora
Copy link

Can confirm it does work on macOS with the latest canary, albeit giving some node_modules warnings, which don't matter here.

[BUILD INFO] Release Channel: canary, Build Number: 8933, Version Hash: 853d8a4b384a443599a4b9349ce7aaa10dbf8a26
2017-12-20 02:34:04.649 
~ python3 -m pip install -U https://github.com/leovoel/BeautifulDiscord/archive/canary.zip
Collecting https://github.com/leovoel/BeautifulDiscord/archive/canary.zip
  Downloading https://github.com/leovoel/BeautifulDiscord/archive/canary.zip
     \ 20kB 3.2MB/s
Requirement already up-to-date: psutil in /usr/local/lib/python3.6/site-packages (from BeautifulDiscord==0.1.0)
Installing collected packages: BeautifulDiscord
  Found existing installation: BeautifulDiscord 0.1.0
    Uninstalling BeautifulDiscord-0.1.0:
      Successfully uninstalled BeautifulDiscord-0.1.0
  Running setup.py install for BeautifulDiscord ... done
Successfully installed BeautifulDiscord-0.1.0

➜  ~ beautifuldiscord --css theme3.css
0: Found Discord Canary
1: Found Discord PTB
Discord executable to use (number): 0
Couldn't copy file ./node_modules/.bin/har-validator, no extracted directory
Couldn't copy file ./node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/.bin/mkdirp, no extracted directory
Couldn't copy file ./node_modules/.bin/rimraf, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-conv, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-sign, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-verify, no extracted directory
Couldn't copy file ./node_modules/.bin/uuid, no extracted directory
Couldn't copy file ./node_modules/create-react-class/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/fbjs/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-conv, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-sign, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-verify, no extracted directory
Couldn't copy file ./node_modules/prop-types/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/react/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/react-dom/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/request/node_modules/.bin/har-validator, no extracted directory
Couldn't copy file ./node_modules/request/node_modules/.bin/uuid, no extracted directory

Done!

You may now edit your /Users/shikhirarora/theme3.css file,
which will be reloaded whenever it's saved.

Thanks @Rapptz 👍

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 20, 2017

@sansation Thanks!

I think it should be fixed now.

@ghost
Copy link

ghost commented Dec 20, 2017

Yep, that issue is fixed now. The only problem is that since I'm on Arch, there's no way to easily apply the CSS. Before, I could use sudo and it would work fine, but now it gives an error because it tries to check in /root/.config/discordcanary/ for the version.

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 20, 2017

Ideally you should no longer need root.

Since the only writing it's doing should reside strictly inside ~/.config it should be fine w/o root.

@ghost
Copy link

ghost commented Dec 20, 2017

~ ➜  beautifuldiscord --css discord.css
Found DiscordCanary under /opt/discord-canary
Couldn't copy file ./node_modules/.bin/har-validator, no extracted directory
Couldn't copy file ./node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/.bin/mkdirp, no extracted directory
Couldn't copy file ./node_modules/.bin/rimraf, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-conv, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-sign, no extracted directory
Couldn't copy file ./node_modules/.bin/sshpk-verify, no extracted directory
Couldn't copy file ./node_modules/.bin/uuid, no extracted directory
Couldn't copy file ./node_modules/create-react-class/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/fbjs/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-conv, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-sign, no extracted directory
Couldn't copy file ./node_modules/http-signature/node_modules/.bin/sshpk-verify, no extracted directory
Couldn't copy file ./node_modules/prop-types/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/react/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/react-dom/node_modules/.bin/loose-envify, no extracted directory
Couldn't copy file ./node_modules/request/node_modules/.bin/har-validator, no extracted directory
Couldn't copy file ./node_modules/request/node_modules/.bin/uuid, no extracted directory
Traceback (most recent call last):
  File "/usr/bin/beautifuldiscord", line 11, in <module>
    load_entry_point('BeautifulDiscord==0.1.0', 'console_scripts', 'beautifuldiscord')()
  File "/usr/lib/python3.6/site-packages/beautifuldiscord/app.py", line 301, in main
    with open(css_injection_path, 'w', encoding='utf-8') as f:
PermissionError: [Errno 13] Permission denied: '/opt/discord-canary/cssInjection.js'

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 20, 2017

I thought I moved that over to a home directory but I didn't. I'll make sure to fix.

@Rapptz
Copy link
Collaborator

Rapptz commented Dec 20, 2017

Should be fixed now. It makes the file over to ~/.beautifuldiscord/cssInjection.js instead of the old location.

I think in the future it should just be a regular cssInjection.js file in the root BD directory and then use that to save the writing etc. But for now this is good enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants