sorunome / mx-puppet-instagram Goto Github PK
View Code? Open in Web Editor NEWAn instagram matrix puppeting bridge
License: Apache License 2.0
An instagram matrix puppeting bridge
License: Apache License 2.0
Currently, if something other than an image is sent, the instagram side just gets the filename. A _matrix/media/r0/download link would be nice, similar to how other bridges work
Following the non-Docker installation directions exactly on a standard Ubuntu box fails when attempting to generate the registration file. (Path below for directory with github clone/build has been simplified to /path/bridge):
npm start -r
[email protected] start /path/bridge/instagram
npm run-script build && node ./build/index.js
[email protected] build /path/bridge/instagram
tsc
Nov-18 19:40:24.758 [PuppetBridge] error: Failed to load registration file Error: ENOENT: no such file or directory, open 'instagram-registration.yaml'
at Object.openSync (fs.js:497:3)
at Object.readFileSync (fs.js:393:35)
at PuppetBridge.readConfig (/path/bridge/instagram/node_modules/mx-puppet-bridge/lib/src/puppetbridge.js:129:49)
at PuppetBridge. (/path/bridge/instagram/node_modules/mx-puppet-bridge/lib/src/puppetbridge.js:154:18)
at Generator.next ()
at /path/bridge/instagram/node_modules/mx-puppet-bridge/lib/src/puppetbridge.js:20:71
at new Promise ()
at __awaiter (/path/bridge/instagram/node_modules/mx-puppet-bridge/lib/src/puppetbridge.js:16:12)
at PuppetBridge.init (/path/bridge/instagram/node_modules/mx-puppet-bridge/lib/src/puppetbridge.js:153:16)
at /path/bridge/instagram/build/index.js:74:22
at Generator.next ()
at /path/bridge/instagram/build/index.js:8:71
at new Promise ()
at __awaiter (/path/bridge/instagram/build/index.js:4:12)
at run (/path/bridge/instagram/build/index.js:73:12)
at Object. (/path/bridge/instagram/build/index.js:203:1)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
errno: -2,
syscall: 'open',
code: 'ENOENT',
path: 'instagram-registration.yaml'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! [email protected] start: npm run-script build && node ./build/index.js
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
It works well but sometimes I cannot understand if a user is from the Instagram puppet or not. I suggest adding something like "(IG)" at the end of the display name.
I thought it is the token I can get from the about screen
but when I try setmatrixtoken
with that long string I get
ERROR: Invalid matrix token
I get this error when linking - is this a bug? I'm unable to link and the link ... ...
message isn't marked as seen.
Installed via matrix-docker-ansible-deploy
. list
and help
in the room with the bot works fine.
Nov 07 07:49:39 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: Nov-7 07:49:39.057 [bot-sdk-Appservice] info: Processing transaction 157
Nov 07 07:49:39 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: Nov-7 07:49:39.058 [bot-sdk-Appservice] info: Processing event of type m.room.message
Nov 07 07:49:39 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: 172.18.0.9 - - [07/Nov/2021:07:49:39 +0000] "PUT /transactions/157?access_token=... HTTP/1.1" 200 2 "-" "Synapse/1.46.0"
Nov 07 07:49:39 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: Nov-7 07:49:39.066 [BotProvisioner] info: Got message to process with arg=link
Nov 07 07:49:40 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: Nov-7 07:49:40.076 [MatrixEventHandler] error: Error handling appservice room.event IgResponseError: POST /api/v1/accounts/read_msisdn_header/ - 302 Found;
Nov 07 07:49:40 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: at Request.handleResponseError (/opt/mx-puppet-instagram/node_modules/instagram-private-api/dist/core/request.js:125:16)
Nov 07 07:49:40 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: at Request.send (/opt/mx-puppet-instagram/node_modules/instagram-private-api/dist/core/request.js:53:28)
Nov 07 07:49:40 jakes-staging-matrix-server matrix-mx-puppet-instagram[2383]: at async AccountRepository.readMsisdnHeader (/opt/mx-puppet-instagram/node_modules/instagram-private-api/dist/repositories/account.repository.js:237:26)
Thanks for creating this!
I've got a DM with the bot, but I'm having trouble bridging rooms. It seems like both listusers
and listrooms
are unimplemented. The output of help
also doesn't show a bridge
command. Am I doing something wrong?
I wanne setup this Bridge but I missed the config.yaml
the buildung was success and so on but it seems the config is currently not included ?
I'm trying to narrow down a bug with IG where the bridge silently stops sending/receiving messages. One thing that would help is a 'ping' command that I could issue in the bridgebot control room that would test the connection. Right now my interim solution is to send a DM to myself from a different IG account.
In other bridges when you import the users from other chat service a string is attached to their names to show where they come from. For example, if I talk to Sorunome from Instagram it would show as "Sorunome (Instagram)".
Would it be possible to add this feature?
I'm not very familiar with Typescript or your library, but I've been looking at the source and maybe it could be added at line 67 of instagram.ts, something like:
name: user.name + ' (Instagram)',
If you can confirm that makes sense I can create a Pull Request.
Have a nice day :)
I don't know what they look like in the app, but in a browser they look like this:
There is post in the Instagram Help Center about it:
https://help.instagram.com/1310346208996329
In there is no notice of it.
got this when trying to login
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:35.735 [bot-sdk-Appservice] �[32minfo�[39m: Processing transaction 5
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:35.742 [bot-sdk-Appservice] �[32minfo�[39m: Processing event of type m.room.message
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:35.748 [PuppetBridge] �[36mverbose�[39m: got matrix event to pass on
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:35.784 [BotProvisioner] �[32minfo�[39m: Got message to process with arg=link
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:35.809 [InstagramPuppet:index] �[36mverbose�[39m: Using username
�[36mmx-puppet-instagram |�[0m 172.18.0.6 - - [16/Jan/2020:16:50:35 +0000] "PUT /transactions/5?access_token=f7486fb6-e8c1-7d-9b4b4abc0a0f HTTP/1.1" 200 2 "-" "Synapse/1.7.2"
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:39.862 [InstagramPuppet:index] �[36mverbose�[39m: ===========
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:39.864 [InstagramPuppet:index] �[36mverbose�[39m: IgCheckpointError: POST /api/v1/accounts/login/ - 400 Bad Request; challenge_required
�[36mmx-puppet-instagram |�[0m at Request.handleResponseError (/opt/mx-puppet-instagram/node_modules/instagram-private-api/dist/core/request.js:103:24)
�[36mmx-puppet-instagram |�[0m at Request.send (/opt/mx-puppet-instagram/node_modules/instagram-private-api/dist/core/request.js:50:28)
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:39.865 [InstagramPuppet:index] �[36mverbose�[39m: Requesting "it was me" button
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:39.867 [InstagramPuppet:index] �[36mverbose�[39m: {
�[36mmx-puppet-instagram |�[0m message: 'challenge_required',
�[36mmx-puppet-instagram |�[0m challenge: {
�[36mmx-puppet-instagram |�[0m url: 'https://i.instagram.com/challenge/923290913/oFQvJ2zVdp/',
�[36mmx-puppet-instagram |�[0m api_path: '/challenge/923290913/oFQvJ2zVdp/',
�[36mmx-puppet-instagram |�[0m hide_webview_header: true,
�[36mmx-puppet-instagram |�[0m lock: true,
�[36mmx-puppet-instagram |�[0m logout: false,
�[36mmx-puppet-instagram |�[0m native_flow: true
�[36mmx-puppet-instagram |�[0m },
�[36mmx-puppet-instagram |�[0m status: 'fail',
�[36mmx-puppet-instagram |�[0m error_type: 'checkpoint_challenge_required'
�[36mmx-puppet-instagram |�[0m }
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:41.910 [InstagramPuppet:index] �[36mverbose�[39m: {
�[36mmx-puppet-instagram |�[0m message: 'challenge_required',
�[36mmx-puppet-instagram |�[0m challenge: {
�[36mmx-puppet-instagram |�[0m url: 'https://i.instagram.com/challenge/923290913/oFQvJ2zVdp/',
�[36mmx-puppet-instagram |�[0m api_path: '/challenge/923290913/oFQvJ2zVdp/',
�[36mmx-puppet-instagram |�[0m hide_webview_header: true,
�[36mmx-puppet-instagram |�[0m lock: true,
�[36mmx-puppet-instagram |�[0m logout: false,
�[36mmx-puppet-instagram |�[0m native_flow: true
�[36mmx-puppet-instagram |�[0m },
�[36mmx-puppet-instagram |�[0m status: 'fail',
�[36mmx-puppet-instagram |�[0m error_type: 'checkpoint_challenge_required'
�[36mmx-puppet-instagram |�[0m }
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:41.950 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-2) PUT http://synapse:8008/_matrix/client/r0/rooms/!nDiuWSLirBVOPNDDOC%3Adonald.nova.chat/send/m.room.message/1579193441949__REQ1
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:42.618 [bot-sdk-Appservice] �[32minfo�[39m: Processing transaction 6
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:42.620 [bot-sdk-Appservice] �[32minfo�[39m: Processing event of type m.room.message
�[36mmx-puppet-instagram |�[0m 172.18.0.6 - - [16/Jan/2020:16:50:42 +0000] "PUT /transactions/6?access_token=f7486fb6-e-827d-9b4b4abc0a0f HTTP/1.1" 200 2 "-" "Synapse/1.7.2"
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:48.837 [bot-sdk-Appservice] �[32minfo�[39m: Processing transaction 7
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:48.840 [bot-sdk-Appservice] �[32minfo�[39m: Processing event of type m.room.message
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:48.841 [PuppetBridge] �[36mverbose�[39m: got matrix event to pass on
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:48.849 [BotProvisioner] �[32minfo�[39m: Got message to process with arg=576804
�[36mmx-puppet-instagram |�[0m 172.18.0.6 - - [16/Jan/2020:16:50:48 +0000] "PUT /transactions/7?access_token=f7486f3a0-827d-9b4b4abc0a0f HTTP/1.1" 200 2 "-" "Synapse/1.7.2"
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:51.689 [InstagramPuppet:index] �[36mverbose�[39m: { action: 'close', status: 'ok' }
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:51.719 [bot-sdk-MatrixLiteClient] �[32minfo�[39m: (REQ-3) PUT http://synapse:8008/_matrix/client/r0/rooms/!nDiuWSLirBVOPNDDOC%3Adonald.nova.chat/send/m.room.message/1579193451718__REQ2
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:52.382 [bot-sdk-Appservice] �[32minfo�[39m: Processing transaction 8
�[36mmx-puppet-instagram |�[0m Jan-16 16:50:52.384 [bot-sdk-Appservice] �[32minfo�[39m: Processing event of type m.room.message
�[36mmx-puppet-instagram |�[0m 172.18.0.6 - - [16/Jan/2020:16:50:52 +0000] "PUT /transactions/8?access_token=f7443a0-827d-9b4b4abc0a0f HTTP/1.1" 200 2 "-" "Synapse/1.7.2"
ie if you read a message in riot, mark message as read in slack
hacky method would be great :)
Hi there! Thanks so much for this bridge. It is an important part of my attempts to unify all the disparate chat services I have to use---without your work, I wouldn't be able to do that.
I've been playing with the bridge and it seems like the bridge doesn't support liking messages, or displaying when whoever I am chatting with has liked my message. Did I overlook some way to set this up? If it's not implemented, and you're looking for a little bit of help, I'd be happy to give it a shot, although I have no experience (...yet) with the internals of anything relating to Matrix.
When you forward an instagram post in the app it sends the image (expected) and an additional line "New media has been shared:"
Maybe it's possible to include the initial author or even some link to the shared posts.
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.