Code Monkey home page Code Monkey logo

mx-puppet-instagram's People

Contributors

aaronraimist avatar ericmigi avatar jdreichmann avatar josteink avatar n0toose avatar sbruder avatar sorunome avatar tulir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

mx-puppet-instagram's Issues

Suggestion: Display links to attachments

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

npm start -r fails with Failed to load registration file Error

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.

Add suffix to the display name

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.

where to get setmatrixtoken

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

Unable to link account (IgResponseError: POST /api/v1/accounts/read_msisdn_header/ - 302 Found)

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)

Usage instructions?

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?

Config.yaml?

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 ?

add health check 'ping' command

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.

Add Instagram identifier to usernames

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 :)

problem with 2fa login

got this when trying to login

image


�[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"

Reaction support

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.

add link or author to shared images

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.

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.