rolfkoenders / potato Goto Github PK
View Code? Open in Web Editor NEW🍿 Mr. Potato is your slackbot for couchpotato!
License: MIT License
🍿 Mr. Potato is your slackbot for couchpotato!
License: MIT License
The bot connects correctly, but I receive a TypeError on every message it receives (commands, but also any chat message)
TypeError: Cannot read property 'id' of undefined
at Bot._isFromBot (/path/potato/node_modules/slackbotify/lib/bot.js:116:33)
at Bot._onMessage (/path/potato/node_modules/slackbotify/lib/bot.js:55:45)
at emitOne (events.js:96:13)
at Bot.emit (events.js:189:7)
at Bot.<anonymous> (/path/potato/node_modules/slackbotify/node_modules/slackbots/index.js:62:18)
at emitTwo (events.js:106:13)
at WebSocket.emit (events.js:192:7)
at Receiver.ontext (/path/potato/node_modules/slackbotify/node_modules/slackbots/node_modules/ws/lib/WebSocket.js:841:10)
at /path/potato/node_modules/slackbotify/node_modules/slackbots/node_modules/ws/lib/Receiver.js:536:18
at Receiver.applyExtensions (/path/potato/node_modules/slackbotify/node_modules/slackbots/node_modules/ws/lib/Receiver.js:371:5)
Make use of the alpine version of the node image so the docker image is much smaller.
I am trying to get the Mr. Potato Container working in a docker-compose.yml file together with couchpotato and some other services.
All services in this file share the same docker network and are reachable though their internal dns name.
Mr. Potato is not able to reach my couchpotato container...
Here is the part of the docker-compose.yml:
mrpotato:
image: rolfkoenders/potato:latest
container_name: mrpotato
env_file: uidgid.env
environment:
- CB_SLACK_KEY=xoxb-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- CB_SLACK_NAME=mr_movie
- CB_HOST=couchpotato
- CB_PORT=5050
- CB_COUCH_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
restart: always
Jun 10 13:17:30 plex potatoBot[15866]: [OMDB] - Error: status code: 401
Jun 10 13:17:30 plex potatoBot[15866]: at /opt/potato/node_modules/omdb/index.js:126:25
Jun 10 13:17:30 plex potatoBot[15866]: at done (/opt/potato/node_modules/needle/lib/needle.js:432:14)
Jun 10 13:17:30 plex potatoBot[15866]: at PassThrough.<anonymous> (/opt/potato/node_modules/needle/lib/needle.js:671:11)
Jun 10 13:17:30 plex potatoBot[15866]: at emitNone (events.js:91:20)
Jun 10 13:17:30 plex potatoBot[15866]: at PassThrough.emit (events.js:185:7)
Jun 10 13:17:30 plex potatoBot[15866]: at endReadableNT (_stream_readable.js:974:12)
Jun 10 13:17:30 plex potatoBot[15866]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
Jun 10 13:17:30 plex potatoBot[15866]: at process._tickCallback (internal/process/next_tick.js:98:9)
Jun 10 13:17:30 plex potatoBot[15866]: /opt/potato/lib/handlers/omdb-search-movie.js:25
Jun 10 13:17:30 plex potatoBot[15866]: #011if (movies.length > 1) {
Jun 10 13:17:30 plex potatoBot[15866]: #011 ^
Jun 10 13:17:30 plex potatoBot[15866]: TypeError: Cannot read property 'length' of null
Jun 10 13:17:30 plex potatoBot[15866]: at _composeResponseMessage (/opt/potato/lib/handlers/omdb-search-movie.js:25:12)
Jun 10 13:17:30 plex potatoBot[15866]: at omdb.search (/opt/potato/lib/handlers/omdb-search-movie.js:17:17)
Jun 10 13:17:30 plex potatoBot[15866]: at omdb.search (/opt/potato/lib/omdb.js:30:12)
Jun 10 13:17:30 plex potatoBot[15866]: at /opt/potato/node_modules/omdb/index.js:126:20
Jun 10 13:17:30 plex potatoBot[15866]: at done (/opt/potato/node_modules/needle/lib/needle.js:432:14)
Jun 10 13:17:30 plex potatoBot[15866]: at PassThrough.<anonymous> (/opt/potato/node_modules/needle/lib/needle.js:671:11)
Jun 10 13:17:30 plex potatoBot[15866]: at emitNone (events.js:91:20)
Jun 10 13:17:30 plex potatoBot[15866]: at PassThrough.emit (events.js:185:7)
Jun 10 13:17:30 plex potatoBot[15866]: at endReadableNT (_stream_readable.js:974:12)
Jun 10 13:17:30 plex potatoBot[15866]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
Jun 10 13:17:30 plex systemd[1]: potatoBot.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 13:17:30 plex systemd[1]: potatoBot.service: Unit entered failed state.
Jun 10 13:17:30 plex systemd[1]: potatoBot.service: Failed with result 'exit-code'.
Same type of error when trying download movie Bad Boys II
Jun 10 13:17:30 plex potatoBot[15866]: [OMDB] - Error: status code: 401
Jun 10 13:17:30 plex potatoBot[15866]: at /opt/potato/node_modules/omdb/index.js:126:25
Jun 10 13:17:30 plex potatoBot[15866]: at done (/opt/potato/node_modules/needle/lib/needle.js:432:14)
Jun 10 13:17:30 plex potatoBot[15866]: at PassThrough.<anonymous> (/opt/potato/node_modules/needle/lib/needle.js:671:11)
Jun 10 13:17:30 plex potatoBot[15866]: at emitNone (events.js:91:20)
Jun 10 13:17:30 plex potatoBot[15866]: at PassThrough.emit (events.js:185:7)
Jun 10 13:17:30 plex potatoBot[15866]: at endReadableNT (_stream_readable.js:974:12)
Jun 10 13:17:30 plex potatoBot[15866]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
Jun 10 13:17:30 plex potatoBot[15866]: at process._tickCallback (internal/process/next_tick.js:98:9)
Jun 10 13:17:30 plex potatoBot[15866]: /opt/potato/lib/handlers/omdb-search-movie.js:25
Jun 10 13:17:30 plex potatoBot[15866]: #011if (movies.length > 1) {
Jun 10 13:17:30 plex potatoBot[15866]: #011 ^
Jun 10 13:17:30 plex potatoBot[15866]: TypeError: Cannot read property 'length' of null
Jun 10 13:17:30 plex potatoBot[15866]: at _composeResponseMessage (/opt/potato/lib/handlers/omdb-search-movie.js:25:12)
Jun 10 13:17:30 plex potatoBot[15866]: at omdb.search (/opt/potato/lib/handlers/omdb-search-movie.js:17:17)
Jun 10 13:17:30 plex potatoBot[15866]: at omdb.search (/opt/potato/lib/omdb.js:30:12)
Jun 10 13:17:30 plex potatoBot[15866]: at /opt/potato/node_modules/omdb/index.js:126:20
Jun 10 13:17:30 plex potatoBot[15866]: at done (/opt/potato/node_modules/needle/lib/needle.js:432:14)
Jun 10 13:17:30 plex potatoBot[15866]: at PassThrough.<anonymous> (/opt/potato/node_modules/needle/lib/needle.js:671:11)
Jun 10 13:17:30 plex potatoBot[15866]: at emitNone (events.js:91:20)
Jun 10 13:17:30 plex potatoBot[15866]: at PassThrough.emit (events.js:185:7)
Jun 10 13:17:30 plex potatoBot[15866]: at endReadableNT (_stream_readable.js:974:12)
Jun 10 13:17:30 plex potatoBot[15866]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
Jun 10 13:17:30 plex systemd[1]: potatoBot.service: Main process exited, code=exited, status=1/FAILURE
Jun 10 13:17:30 plex systemd[1]: potatoBot.service: Unit entered failed state.
Jun 10 13:17:30 plex systemd[1]: potatoBot.service: Failed with result 'exit-code'.
Jun 10 13:17:40 plex systemd[1]: potatoBot.service: Service hold-off time over, scheduling restart.
Jun 10 13:17:40 plex systemd[1]: Stopped Potato Bot.
Jun 10 13:17:40 plex systemd[1]: Started Potato Bot.
Jun 10 13:18:36 plex potatoBot[15887]: [OMDB] - Error: status code: 401
Jun 10 13:18:36 plex potatoBot[15887]: at /opt/potato/node_modules/omdb/index.js:211:25
Jun 10 13:18:36 plex potatoBot[15887]: at done (/opt/potato/node_modules/needle/lib/needle.js:432:14)
Jun 10 13:18:36 plex potatoBot[15887]: at PassThrough.<anonymous> (/opt/potato/node_modules/needle/lib/needle.js:671:11)
Jun 10 13:18:36 plex potatoBot[15887]: at emitNone (events.js:91:20)
Jun 10 13:18:36 plex potatoBot[15887]: at PassThrough.emit (events.js:185:7)
Jun 10 13:18:36 plex potatoBot[15887]: at endReadableNT (_stream_readable.js:974:12)
Jun 10 13:18:36 plex potatoBot[15887]: at _combinedTickCallback (internal/process/next_tick.js:74:11)
Jun 10 13:18:36 plex potatoBot[15887]: at process._tickCallback (internal/process/next_tick.js:98:9)
Lets remove the gulp
dependency and move all the scripts to npm scripts.
First of all: Thanks for your great work!
I got an idea which could improve the usability. I want to explain this with an example:
Let´s search for the german movie "Ein Prophet" with the command:
movie search "Ein Prophet"
That´s the search result:
I found the following movies
• A Prophet 🆔 tt1235166
• Death of a Prophet 🆔 tt0179757
• Earthsea 🆔 tt0407384
I am looking now at IMDB if the movie with the ID tt1235166 is the one i was looking for.
And yes, it´s the correct one form the year 2009.
So what i am doing now is this:
download movie "A Prophet"
As a normal user, i would expect that CP is downloading the first movie of the search result.
But CP is downloading "A Prophet" from the year 1999.
I know that with "download movie tt1235166" CP downloads the correct one but is it possible to download the correct one depending on the search results?
Hi there :)
do you have some suggestions?
doesn't return anything, it that the right command?
Also, help
doesn't list all available commands, it only has:
*Here you go!
To *search* for a movie send me:
`search movie movie-title`
To *add* a movie to the wanted list:
`download movie movie-title`
Or if you know the *IMDB id* (which is also returned by searching for a movie) send me:
`download movie IMDB-id`
I really like :popcorn: so you can always give me some!
*Admin commands*
!version _Check which version of the bot and couchpotato is running.
P.S.
A huge thank you for writing this bot!
DM's work now (thanks!), but when I try the same commands in a channel, no luck.
e.g.: search movie harry potter
works in DM, but I tried @couchpotato search movie harry potter
and just search movie harry potter
in the channel...no reply. (no error log either)
Am I just doing it wrong?
Edit:
I just realized it is a private channel, but also just tried creating a public channel. Doesn't work there either :(
Are people using the download movie <movie name>
command?
I'm thinking of removing the command because its not reliable. Since the OMDB api is closed the search is now done using the search of couchpotato. There are allot of results coming back which cannot be easily handled by the bot.
search movie <movie name>
command. You will get a single or a list of movies in response. Every movie has e tt...
id next to it. This id can be copied and using the download movie <imdb_id>
command the movie will be added to the wanted list.download movie <movie name>
command.Let me know what you think!
What am I doing wrong here?
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
> [email protected] start /opt/mr.potato
> node bin/bot.js
/opt/mr.potato/lib/handlers/download-movie.js:7
let couch = new CouchAPI(config.get('couch'));
^
TypeError: config.get is not a function
at Object.<anonymous> (/opt/mr.potato/lib/handlers/download-movie.js:7:33)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/opt/mr.potato/lib/handlers/index.js:2:30)
at Module._compile (module.js:571:32)
npm ERR! Linux 4.4.0-36-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `node bin/bot.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script 'node bin/bot.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the potato package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node bin/bot.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs potato
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls potato
npm ERR! There is likely additional logging output above.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.