What is the reason file not uploaded in Instragram via python code - instagram
I have tried to upload the video file in MacOS using python3 but no luck every time it shows uploaded but I do not see the video file in my Instagram account. Could you please provide reason for the same? where is the file now?
Code:
from instabot import *
bot = Bot()
bot.login(username = "xx", password="xx")
bot.upload_video("IMG_6517.m4v",caption ="First Video install directly from myPc without using Insta UI")
Result:
2020-06-06 14:24:31,763 - INFO - Started uploading
'/Users/samirthantharate/Desktop/IMG_6517.m4v'
2020-06-06 14:24:31,763 - INFO - Started uploading
'/Users/samirthantharate/Desktop/IMG_6517.m4v'
Analizing /Users/samirthantharate/Desktop/IMG_6517.m4v
FOUND w:720, h:1280, rotation=0, ratio=0.5625
Vertical video
Cropping video
2020-06-06 14:25:06,836 - INFO - Video
'/Users/samirthantharate/Desktop/IMG_6517.m4v' uploaded
2020-06-06 14:25:06,836 - INFO - Video
'/Users/samirthantharate/Desktop/IMG_6517.m4v' uploaded
{'upload_id': '1591433671764', 'device_timestamp': '1591433671764'}
There is no issue in the python script nor the library, the real issue is the soft ban imposed upon your account by Instagram. Instagram has been actively monitoring such activities and imposing such soft bans stealthily. I suggest you try after 5-10 days, I can make sure that the script would start working.
Such issues have been reported already, do see those issues over here:
https://github.com/ohld/igbot/issues/1211
https://github.com/ohld/igbot/issues/1194
Also, the following python script is now detectable by Instagram as specified by the author in Readme https://github.com/ohld/igbot/blob/master/OLD_README.md
Related
Can we upload media files using URL in MediaFileUpload?
Basically all I want to know is, I am working on Youtube API to upload videos on my channel. Whenever I try to upload video from my local file, it works without any issue. But if I want to upload some videos which are already hosted on S3, it gives me error related to OS i.e. OSError: File not found at that location. So is there any way to upload video using youtube API from already hosted URLs ? P.S. I am following the documentation of youtube API and using MediaFileUpload to upload the video files. Edit 1: I tried a minor hack around this particular issue and works fine for me. Just leaving it here for future developers. import requests from six import BytesIO url = "" # The video url you want to upload (I use S3 urls, not sure if it will work with youtube urls) res = requests.get(url) file = BytesIO(res.content) media = MediaIoBaseUpload(file, mimetype="application/octet-stream")
How to list call recordings in Nexmo?
I'm working on a voice assistant with Nexmo. I use Node-RED to build the NCCO object including a record node. In the provided tutorials by Nexmo, e.g. Build Your Own Voicemail With Node-RED and the Nexmo Voice API the directly download the recording to the local machine. In my case, don't want to immediately download the audio file via node-red but let Nexmo store my audios and download them all together later through e.g. a Python script. In the docs it says that "NOTE: After your recording is complete, it is stored by Nexmo for 30 days before being automatically deleted". Unfortunately, I can't find any reference about where the audios are stored in my Nexmo account and how to list all recordings/recording urls of a Nexmo application. Thank you for any help. Nina
Currently there’s no way to get the recordings as a list from Nexmo. What you could do instead is, capture the API response from the recording webhook and log it. Then later on when you’re ready to download them, read it back to a get recording node. If you connect a debug node into the /recording webhook, you can see the structure of the message object. payload: object start_time: "2020-03-04T13:06:40Z" recording_url: "https://api.nexmo.com/v1/files/516f74a8-abcd-4270-b553-2582650a2e5a" size: 26478 recording_uuid: "dbd3cb68-0a3a-4c89-bc2d-7c38abd2c497" end_time: "2020-03-04T13:06:47Z" conversation_uuid: "CON-93ef5eef-gg92-49ae-9e01-f3c782390dd9" timestamp: "2020-03-04T13:06:47.733Z" You’ll need the recording_url to download a recording, but it’s good to keep the conversation_uuid handy, as you can lookup the FROM and TO numbers based on this. I'm leaving a possible solution with Google Sheets below, as a replacement for the /recording webhook. Import it from clipboard into your editor and see the comment node for instructions :) [{"id":"9198a326.cfb3e","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"49dc7444.625ff4","type":"http in","z":"9198a326.cfb3e","name":"","url":"/record","method":"post","upload":false,"swaggerDoc":"","x":210,"y":380,"wires":[["21594561.f44c1a","47021216.a25afc","dc814f00.17fa7"]]},{"id":"47021216.a25afc","type":"http response","z":"9198a326.cfb3e","name":"","statusCode":"","headers":{},"x":610,"y":380,"wires":[]},{"id":"5371302c.ee3688","type":"getrecording","z":"9198a326.cfb3e","creds":"10de89c6.d1db3e","filename":"recordings/{{msg.payload.from}}_{{msg.payload.timestamp}}.mp3","x":1260,"y":580,"wires":[["6d03a7ed.2a6d7","38dd6acf.b46cae"]]},{"id":"21594561.f44c1a","type":"debug","z":"9198a326.cfb3e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":450,"y":320,"wires":[]},{"id":"bcb08110.c2f7c","type":"e-mail","z":"9198a326.cfb3e","server":"smtp.gmail.com","port":"465","secure":true,"tls":true,"name":"","dname":"","x":1690,"y":580,"wires":[]},{"id":"6d03a7ed.2a6d7","type":"debug","z":"9198a326.cfb3e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1490,"y":500,"wires":[]},{"id":"38dd6acf.b46cae","type":"change","z":"9198a326.cfb3e","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"'Voicemail from ' & msg.req.query.from","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1500,"y":580,"wires":[["bcb08110.c2f7c"]]},{"id":"c8fadcb1.13aca","type":"inject","z":"9198a326.cfb3e","name":"Download/Send recordings in email","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":280,"y":580,"wires":[["af254a75.791888"]]},{"id":"f9706ea5.ea66","type":"change","z":"9198a326.cfb3e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t \"start_time\": (msg.payload)[0],\t \"recording_url\": (msg.payload)[1],\t \"size\": (msg.payload)[2],\t \"recording_uuid\": (msg.payload)[3],\t \"end_time\": (msg.payload)[4],\t \"conversation_uuid\": (msg.payload)[5],\t \"timestamp\": (msg.payload)[6],\t \"from\": (msg.payload)[7]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1060,"y":580,"wires":[["5371302c.ee3688"]]},{"id":"9f017b25.db6fe8","type":"debug","z":"9198a326.cfb3e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":970,"y":440,"wires":[]},{"id":"dc814f00.17fa7","type":"change","z":"9198a326.cfb3e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[payload.start_time, payload.recording_url, payload.size, payload.recording_uuid, payload.end_time, payload.conversation_uuid, payload.timestamp, req.query.from]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":440,"wires":[["c8118876.f668e"]]},{"id":"521189f7.2f6d8","type":"debug","z":"9198a326.cfb3e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":830,"y":760,"wires":[]},{"id":"deba2a63.a4f4d","type":"split","z":"9198a326.cfb3e","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":830,"y":580,"wires":[["f9706ea5.ea66"]]},{"id":"c8118876.f668e","type":"GSheet","z":"9198a326.cfb3e","creds":"90e07aa9.34a6","method":"append","action":"","sheet":"1mmXhj40aeSooxmtku3ma4auLyrHhJO8xCSQsklZ1_BU","cells":"Sheet4!A1","name":"","x":730,"y":440,"wires":[["9f017b25.db6fe8"]]},{"id":"af254a75.791888","type":"GSheet","z":"9198a326.cfb3e","creds":"bd7b95fd.c3dee8","method":"get","action":"","sheet":"1mmXhj40aeSooxmtku3ma4auLyrHhJO8xCSQsklZ1_BU","cells":"Sheet4!A:H","name":"","x":610,"y":580,"wires":[["521189f7.2f6d8","deba2a63.a4f4d"]]},{"id":"335f8e96.7242ba","type":"comment","z":"9198a326.cfb3e","name":"📖 Instructions","info":"1. Install `node-red-contrib-google-sheets` package and restart Node-RED.\n2. Add _creds_, _SpreadsheetID_ and _Cells_ in the **GSheet** nodes \n3. Add your Nexmo credentials in the **Get Recording** node\n4. Configure **email** node or add download functionality","x":220,"y":180,"wires":[]},{"id":"10de89c6.d1db3e","type":"nexmovoiceapp","z":"","name":"New Voice App"},{"id":"90e07aa9.34a6","type":"gauth","z":"9198a326.cfb3e"}]
Unable to send pdf file from bot to user in ms teams
NodeJS BotBuilder SDK version: 3.15.0 My code: var pdf = { name: '<file_name>.pdf', contentType: 'application/pdf', contentUrl: '<https url to public pdf file>' }; var reply = new builder.Message(session).addAttachment(pdf); session.send(reply); This code is the same in few online examples. The issue I have is that I always get error: Error: POST to 'https://smba.trafficmanager.net/emea/v3/conversations/a%3A1TwHmhoGuZP2Mf9P0TTnjv8HkcaXzEHryv0sYCvDDUI-qrMitJtHRlAnIcedcDH_v3IfMBXtg_zo5MDVcS0-8hDCQ4sJzpJhrewBPK8uWJXYeShgmd-s7uh5o8kW4ebAP/activities/1543588440246' failed: [400] Bad Request For image/png this code works fine. What I want to achieve is this: (image is taken from Bot Framework Emulator) File from the web sent from bot to user The file is sent from bot without uploading it to users's one drive. This works also when I tested the feature in test section of https://dev.botframework.com/bots. It doesn't work only in ms teams.
The behaviour for sending files can differ per channel. Microsoft Teams doesn't support the direct upload method, like the WebChat / Emulator does. This is due to compliance reasons, as Bill Bliss stated. You can post messages with card attachments referencing existing SharePoint files using the Microsoft Graph APIs for OneDrive and SharePoint. Using the Graph APIs requires obtaining access to a user's OneDrive folder (for personal and groupchat files) or the files in a team's channels (for channel files) through the standard OAuth2 authorization flow. This method works in all Teams contexts. Have a look at Send and receive files through your bot for the full documentation and how to implement. An alternative option would be to use an AdaptiveCard where you can use an image thumbnail of the document combined with a button to directly download the PDF file from your public accessible URL.
google cloud vision 403 permission denied error(other questions didn't work)
I am trying to perform OCR on pdf documents using google cloud vision API, i uploaded a pdf document into a cloud bucket and downloaded the oauth key file and added it in the script as below. But when i run the file, i get the permissiondenined: 403 error, can anyone please give me instructions on how to fix it, i did extensive google search and did not yield any results, i am surely missing something here. #authenitcation file os.environ["GOOGLE_APPLICATION_CREDENTIALS"]="mykeylocation/key1.json" #method being called operation = client.async_batch_annotate_files(requests=[async_request]) #error message PermissionDenied: 403 Error opening file: gs://myocrbucket-vamsi/2017 Form 3W-2.pdf. I have checked the older stack overflow questions and the links provided in answers are not active anymore. Thanks in advance for your help.
Add your client_email to member of your bucket and give necessary role(s) for it, find it from your json key file. Storage Bucket -> Permissions -> Add member
php library for flickr API
I am banging my head trying to use Flickr API... My goal is to be able to upload images and create albums in my Flickr account from my website... I tried the phpFlickr library but apparently it needs updates for getting authenticated tokens...It keeps giving me "Invalid auth token". I did some reading on how to get tokens and using DPZFlickr managed to get oauth_token & oauth_verifier but failed to exchange that with an access token...It also failed in uploading any photo to my account using the included upload.php example (Giving me an "empty" error!). After digging in DBZ flickr.php code, I managed to get this error when trying to upload to Flickr: "oauth_problem=signature_invalid&" So I began to search how to create a valid signature to eventually get a valid access token...and concluded that it is quite some work to be done here if I am going to build everything from scratch. So my question is: Are there any updated php libraries that I can use to successfully create albums and upload photos to my Flickr account? Or should I go ahead and try building one?
OK..I finally got it to work with the DPZ library. For future reference anybody facing the same problem as I had: I managed to create an album using DPZFlickr by changing the method in auth.php to flickr.photosets.create....which indicated that the library correctly generates an access token with write permission.. However, the upload example kept giving me the "Invalid signature" error.... I checked the code. Flickr.php correctly unsets the photo parameter before signing the request then adds it back and submits the request which is exactly as indicated in: www.flickr.com/services/api/upload.api.html I found a discussion in https://www.flickr.com/groups/51035612836#N01/discuss/72157650261711318/ that cleared out that the error was not actually a signature problem, but rather the 'photo' parameter that is being sent is the problem. It's just that Flickr doesn't know what to do with the photo parameter so it sends the signature error. So what' wrong with the photo parameter? Flickr API requires that the image has to be sent in binary form...The DBZ library, Flickr.php script line 677, does the hard work for us using the cURL function in php (http://au.php.net/manual/en/function.curl-setopt.php). It sends the $parameters (which includes the uploaded photo) to the post field of the http request which should do the upload in binary format for us. However, a brilliant comment I found in CURL PHP send image states that: "CURLOPT_SAFE_UPLOAD defaulted to true in 5.6.0... so you will need to add curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false); before setting CURLOPT_POSTFIELDS" Checking the manual: http://au.php.net/manual/en/function.curl-setopt.php it says: "Added in PHP 5.5.0 with FALSE as the default value. PHP 5.6.0 changes the default value to TRUE." So if your php version is 5.5.0 the library will work just fine whilst if using version PHP 5.6.0 you need to add a line before 677 in Flickr.php to change the CURLOPT_SAFE_UPLOAD to false (that's why the library works with some and others not). To solve the issue...Just add this line before line 677 in Flickr.php: curl_setopt($curl, CURLOPT_SAFE_UPLOAD, false); That's it. (-: