Coder Social home page Coder Social logo

Canary issue? about beautifuldiscord HOT 22 CLOSED

AlexFlipnote avatar AlexFlipnote commented on August 19, 2024
Canary issue?

from beautifuldiscord.

Comments (22)

Rapptz avatar Rapptz commented on August 19, 2024 1

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

from beautifuldiscord.

simoniz0r avatar simoniz0r commented on August 19, 2024 1

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.

from beautifuldiscord.

shikhir-arora avatar shikhir-arora commented on August 19, 2024

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...

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

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

from beautifuldiscord.

shikhir-arora avatar shikhir-arora commented on August 19, 2024

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'

from beautifuldiscord.

shikhir-arora avatar shikhir-arora commented on August 19, 2024

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.

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

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

from beautifuldiscord.

simoniz0r avatar simoniz0r commented on August 19, 2024

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.

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

image

Like I said, not quite.

from beautifuldiscord.

simoniz0r avatar simoniz0r commented on August 19, 2024

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

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

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

from beautifuldiscord.

simoniz0r avatar simoniz0r commented on August 19, 2024

@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".

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

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

from beautifuldiscord.

simoniz0r avatar simoniz0r commented on August 19, 2024

[REDACTED]
See proper output below

from beautifuldiscord.

 avatar commented on August 19, 2024
~ ➜  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']

from beautifuldiscord.

shikhir-arora avatar shikhir-arora commented on August 19, 2024

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 👍

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

@sansation Thanks!

I think it should be fixed now.

from beautifuldiscord.

 avatar commented on August 19, 2024

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.

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

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.

from beautifuldiscord.

 avatar commented on August 19, 2024
~ ➜  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'

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

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

from beautifuldiscord.

Rapptz avatar Rapptz commented on August 19, 2024

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.

from beautifuldiscord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.