Closed x23piracy closed 8 years ago
Hi,
i could fix /i and /t by the pull request available but /s and weburl still not working (permission problem see above) Please help.
Regards X23
You can use CutyCapt instead of pageres-cli, just go to the terminal and type:
sudo apt-get install xvfb x11-xkb-utils xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic x11-apps && sudo apt-get install cutycapt
After installing CutyCapt, go to utils/media_sender.py and change pageres "%s" 1024x2300 --crop --filename=%s
to xvfb-run --server-args="-screen 0, 1024x768x24" cutycapt --url=%s --out=%s --min-width=1024 --min-height=768
in line 174
Hope it works ;)
About the permission problem with /tmp folder, you need to change media_storage_path = "/tmp/"
in config.py to media_storage_path = "/home/tmp/"
by example, that works for me.
Hi,
thank you for the answers, when i change the path away from /tmp to /home/tmp i still get permission errors: http://pastebin.com/wrfxyFvH
I will now try using CutyCapt
Regards X23
Hi,
i've now also made the changes regarding to cutycapt like you told me but i still have permission errors: http://pastebin.com/zT9LqWiU
How do i install npm or it's modules without root?
This can be seen in the shell without the changes to media_sender.py:
You are not allowed to run this app with root permissions. If running without sudo doesn't work, you can either fix your permission problems or change where npm stores global packages by putting ~/npm/bin in your PATH and running: npm config set prefix ~/npm
I found this on the web: http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo
Regards X23
A "segmentation fault error" happens with only a few websites, for example, a large website can cause that error. Try another website, such as google.com (with CutyCapt)
Hi,
i use CutyCapt but i still receive this when pasting normal weblinks: This happens to every link i try and /tmp is readable writeable since every other function that is writing and reading to /tmp is working.
router.py [INFO]2016-01-27 22:42:56,672[4917xxxxxxxxxx@s.whatsapp.net] http://gmx.de You are not allowed to run this app with root permissions. If running without sudo doesn't work, you can either fix your permission problems or change where npm stores global packages by putting ~/npm/bin in your PATH and running: npm config set prefix ~/npm
See: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md _mediasender.py [ERROR][2016-01-27 22:43:04,245] Either specified path does not exist, or yowsup doesn't have permission to read: /tmp/058b30fc5366a27ef0fc9ed2b345286614539309.png Traceback (most recent call last): File "/opt/whatsapp-bot-seed-master/src/utils/media_sender.py", line 53, in send_by_url self.send_by_path(jid, file_path, caption) File "/opt/whatsapp-bot-seed-master/src/utils/media_sender.py", line 65, in send_by_path entity = RequestUploadIqProtocolEntity(self.MEDIA_TYPE, filePath=path) File "/usr/local/lib/python2.7/dist-packages/yowsup/layers/protocol_media/protocolentities/iq_requestupload.py", line 27, in init assert os.path.exists(filePath), "Either specified path does not exist, or yowsup doesn't have permission to read: %s" % filePath AssertionError: Either specified path does not exist, or yowsup doesn't have permission to read: /tmp/058b30fc5366a27ef0fc9ed2b345286614539309.png
Everything else works fine, what is the problem here?
Regards X23
I don't know what happens, sorry :/
Hi,
it seems that npm cannot run as root:
You are not allowed to run this app with root permissions. If running without sudo doesn't work, you can either fix your permission problems or change where npm stores global packages by putting ~/npm/bin in your PATH and running: npm config set prefix ~/npm
But howto fix that? i already added ~/npm/bin to path and executed: npm config set prefix ~/npm
My defaut linux machine account is root. :( Maybe i need to add anoter account to the machine (non root) and try with that but how does it work simply adding a user, logon with it and run the bot is the goal?
Regards X23
Hi,
when i call: pageres in shell i get:
root@NbI-1527:/opt/whatsapp-bot-seed-master/src/utils# pageres You are not allowed to run this app with root permissions. If running without sudo doesn't work, you can either fix your permission problems or change where npm stores global packages by putting ~/npm/bin in your PATH and running: npm config set prefix ~/npm
See: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md
Hi,
i hacked the pageres root permission away with commenting sudoBlock() away from cli.js :D But still errors:
fyi it doesnt matter of file path is /tmp or /home/tmp, files are not created thats the reason it cannot access them.
with pageres
router.py [INFO]2016-01-27 23:28:26,490[491782330088@s.whatsapp.net] http://www.google.de TypeError: Object #
with CutyCapt
router.py [INFO]2016-01-27 23:30:00,715[491782330088@s.whatsapp.net] http://www.google.de _mediasender.py [ERROR][2016-01-27 23:30:10,769] Either specified path does not exist, or yowsup doesn't have permission to read: /tmp/108eca7b644e2c5e09853619bc416ed014539338.png Traceback (most recent call last): File "/opt/whatsapp-bot-seed-master/src/utils/media_sender.py", line 53, in send_by_url self.send_by_path(jid, file_path, caption) File "/opt/whatsapp-bot-seed-master/src/utils/media_sender.py", line 65, in send_by_path entity = RequestUploadIqProtocolEntity(self.MEDIA_TYPE, filePath=path) File "/usr/local/lib/python2.7/dist-packages/yowsup/layers/protocol_media/protocolentities/iq_requestupload.py", line 27, in init assert os.path.exists(filePath), "Either specified path does not exist, or yowsup doesn't have permission to read: %s" % filePath AssertionError: Either specified path does not exist, or yowsup doesn't have permission to read: /tmp/108eca7b644e2c5e09853619bc416ed014539338.png
Argh :) Any ideas?
Regards X23
same issue, did u get it fixxed?
This is a user permission problem. First make a test: log in with the same user that runs the bot. Check if a pageres (or CutyCapt) command runs ok on command line, if it have the necessary permissions read/write on the output folder (default is /tmp/, so it should) pageres have a problem of not allowing it to be run with a sudo, probably that's the issue.
today is not my day. fixxed it by creating a temp dir in scriptfolder and givivng it chmod 777, but running into the next issue:
tts is working, utube, image sending is working. now the search is not working..
_router.py_ [INFO][2016-01-28 15:47:17,846] (GROUP)[4915142540521@s.whatsapp.net]-[4915142540521-1453975202@g.us] /s looking _connectionpool.py_ [INFO][2016-01-28 15:47:17,848] Starting new HTTP connection (1): ajax.googleapis.com _router.py_ [ERROR][2016-01-28 15:47:18,382] Error routing message: /s looking Message: ID: 1453992436.--325 From: 4915142540521-1453975202@g.us Type: text Timestamp: 1453992437 Participant: 4915142540521@s.whatsapp.net Body: /s looking Traceback (most recent call last): File "/home/scripts/wabot/test/whatsapp-bot-seed/src/router.py", line 72, in handle_callback data = callback(message, match) File "/home/scripts/wabot/test/whatsapp-bot-seed/src/views/google.py", line 29, in google_search page_url = urllib.unquote(req.json()["responseData"]["results"][0]["url"]) AttributeError: 'module' object has no attribute 'unquote'
@joaoricardo000 any idea mate?
Wow.. any idea! Why would this not work?
> import urllib
> urllib.unquote
<function urllib.unquote>
urllib is python default..
got it fixxed by updating all pip packages
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U
the permission error seems to be still existing. the thing is, videos will be downloaded to that directory and can be sent.
the images will not even get created. it says: "cant read file home/bla/bot/temp/image.jpg" but the image.jpg is not even in the directory.
File "/home/scripts/wabot/test/whatsapp-bot-seed/src/utils/media_sender.py", line 52, in send_by_url self.send_by_path(jid, file_path, caption) File "/home/scripts/wabot/test/whatsapp-bot-seed/src/utils/media_sender.py", line 64, in send_by_path entity = RequestUploadIqProtocolEntity(self.MEDIA_TYPE, filePath=path) File "/home/scripts/wabot/test/whatsapp-bot-seed/venv/local/lib/python2.7/site-packages/yowsup/layers/protocol_media/protocolentities/iq_requestupload.py", line 27, in __init__ assert os.path.exists(filePath), "Either specified path does not exist, or yowsup doesn't have permission to read: %s" % filePath AssertionError: Either specified path does not exist, or yowsup doesn't have permission to read: /home/scripts/wabot/test/whatsapp-bot-seed/temp/2b6f793df061f0a6dd577683d33ddfab14539941.png
2b6f793df061f0a6dd577683d33ddfab14539941.png
does not exist
Any idea how to solve this problem? /search is not working. Tried with cutycapt and pageres.
Problem Solved:
Using cutycapt Add .png after %s
cmd = 'xvfb-run --server-args="-screen 0, 1024x768x24" cutycapt --url=%s --out=/home/whatsapp/tmp/%s.png --min-width=1024 --min-height=768' % (page_url, file_name)
confirmed, well done :)
@andremacola @x23piracy how did you get it fixed? where do I have to add the @andremacola solution?? Thanks
Hi,
i have the same issue and i don't think that this is a filesystem problem its seems that it's another pakage used that will not work as root: http://pastebin.com/9WNJP9pU
You are not allowed to run this app with root permissions. If running without sudo doesn't work, you can either fix your permission problems or change where npm stores global packages by putting ~/npm/bin in your PATH and running: npm config set prefix ~/npm
I've done what the error message told me also i uninstalled all npm modules and reinstalled them via nvm without needed root but anyway the error persists.
The above happens while using /s
When using /t the bot answers only {!} but an mp3 file is been created under /tmp: http://i.imgur.com/9F0242q.png
When using /i i get the error: TypeError: 'NoneType' object has no attribute 'getitem' http://pastebin.com/kFVuaKkv
When sending web url like http://google.de it same error like with /s and permission problem with the /tmp path
What works is http links to pictures and youtube videos.
Any ideas which modules are the problem here and howto fix this issues?
Regards X23