Instagram api thumbnail_url gives 5xx Server Error - instagram

thumbnail_url link gives 5xx Server Error only for slide show posts. Works fine for Video and Image only posts.
Failing case: https://www.instagram.com/p/BvEv0AVlgGb
API Call:
https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BvEv0AVlgGb
Response:
{
"version": "1.0",
"title": "Higher. Further. Faster. Complete your #CaptainMarvel look with these Carol Danvers-approved glasses from #diffeyewear! Shop now at diffeyewear.com #ad",
"author_name": "marvel",
"author_url": "https://www.instagram.com/marvel",
"author_id": 204633036,
"media_id": "2000934416420307355_204633036",
"provider_name": "Instagram",
"provider_url": "https://www.instagram.com",
"type": "rich",
"width": 658,
"height": null,
"html": "<blockquote ......>",
"thumbnail_url": "https://scontent-sin2-2.cdninstagram.com/vp/d49a6c1ebb809f2a678807c6c668dc20/5D4E7C9B/t51.2885-15/e35/s612x612/51757368_424979878262102_7818160988900314568_n.jpg?_nc_ht=scontent-sin2-2.cdninstagram.com",
"thumbnail_width": 612,
"thumbnail_height": 611
}
This image post works fine: https://www.instagram.com/p/BvE6t9fA3BE
Why is the thumbnail url broken only for image stacks?

The best way to track this information is by adding the __a=1 param and value to the original url. This will return a GraphQL response which holds all the required information.
For the failing case posted above: https://www.instagram.com/p/BvEv0AVlgGb, simply change the url to https://www.instagram.com/p/BvEv0AVlgGb?__a=1

Related

Azure Data Factory Pagination - get next page with AbsoluteURL

I am trying to get the next page from API response, I have already tried using "AbsouteURL" which seems to "work" as it tries to call that URL (I can see that in the ADF output log).
The issue seems to be the response not having correct url in the response, it just says 0.0.0.0 instead of actual URL.
example:
"meta": {
"count": 500,
"pageCount": 10,
"totalCount": 50000,
"next": "http://0.0.0.0:3000/myData/myDataId?page=2&limit=25",
"previous": null,
"self": "http://0.0.0.0:3000/myData/myDataId?page=1&limit=25",
"first": "http://0.0.0.0:3000/myData/myDataId?page=1&limit=25",
"last": "http://0.0.0.0:3000/myData/myDataId?page=400&limit=25"
},
Is is possible to replace "0.0.0.0" with actual host name i.e. 'myWebApplication' when passing using "AbsouteURL" property?

Sending JSON Payload to Slack via AWS Lambda

I am trying to build a Slack app by using AWS lambda and NodeJs. The issue I am facing is that I don't understand in what format does the SlackBot need the JSON payload from my AWS lambda code to display it.
I followed the tutorial video suggested on Slack linked here. In the video, the following JSON object is created and returned from the AWS lambda.
const response = {
statusCode: 200,
body: "Sample Response",
};
The SlackBot posts the text entered in the 'body' property (i.e. 'Sample Response' in this case) as a response. This seems to be working well. But, I need some more flair than simple text so I looked into their Block Kit UI builder. But there seems to be no documentation for how to do this with a similar 'response' JSON object like this. How exactly am I supposed to use the JSON object created by the UI builder?
I do not know much about Web development so sorry if this seems like a very basic question. I wish there was a sample Slack app on their website which showed this.
The following may work for you (I use a similar one on the production);
{
"channel": "your-channel-name",
"username": "channel-username",
"attachments": [
{
"title": "some-title",
"fallback": "some message",
"text": "some text",
"fields": [
{
"title": "sub-title",
"value": "sub-title-value",
"short": true
},
{
"title": "some-other-title",
"value": "some-value"
}
],
"color": "red"
}
],
"icon_emoji": "gun"
}
This link or this one may provide some extra information.

Cannot scrape google play reviews by using url "https://play.google.com/store/getreviews" by post request

I tried every code available in internet for scraping google playstore. The url "https://play.google.com/store/getreviews" worked for 1 day. It is not working now. I'm getting 404 error.
Please help
You could try a third-party solution like SerpApi. We handle proxies, solve captchas, and parse all rich structured data for you.
With this API you can retrieve up to 199 reviews per page, and then use next_page_token to get the rest.
Example python code for retrieving YouTube reviews (available in other libraries also):
from serpapi import GoogleSearch
params = {
"api_key": "SECRET_API_KEY",
"engine": "google_play_product",
"store": "apps",
"gl": "us",
"product_id": "com.google.android.youtube",
"all_reviews": "true"
}
search = GoogleSearch(params)
results = search.get_dict()
Example JSON output:
"reviews": [
{
"title": "Qwerty Jones",
"avatar": "https://play-lh.googleusercontent.com/a/AATXAJwSQC_a0OIQqkAkzuw8nAxt4vrVBgvkmwoSiEZ3=mo",
"rating": 3,
"snippet": "Overall a great app. Lots of videos to see, look at shorts, learn hacks, etc. However, every time I want to go on the app, it says I need to update the game and that it's \"not the current version\". I've done it about 3 times now, and it's starting to get ridiculous. It could just be my device, but try to update me if you have any clue how to fix this. Thanks :)",
"likes": 586,
"date": "November 26, 2021"
},
{
"title": "matthew baxter",
"avatar": "https://play-lh.googleusercontent.com/a/AATXAJy9NbOSrGscHXhJu8wmwBvR4iD-BiApImKfD2RN=mo",
"rating": 1,
"snippet": "App is broken, every video shows no dislikes even after I hit the button. I've tested this with multiple videos and now my recommended is all messed up because of it. The ads are longer than the videos that I'm trying to watch and there is always a second ad after the first one. This app seriously sucks. I would not recommend this app to anyone.",
"likes": 352,
"date": "November 28, 2021"
},
{
"title": "Operation Blackout",
"avatar": "https://play-lh.googleusercontent.com/a-/AOh14GjMRxVZafTAmwYA5xtamcfQbp0-rUWFRx_JzQML",
"rating": 2,
"snippet": "YouTube used to be great, but now theyve made questionable and arguably stupid decisions that have effectively ruined the platform. For instance, you now have the grand chance of getting 30 seconds of unskipable ad time before the start of a video (or even in the middle of it)! This happens so frequently that its actually a feasible option to buy an ad blocker just for YouTube itself... In correlation with this, YouTube is so sensitive twords the public they decided to remove dislikes. Why????",
"likes": 370,
"date": "November 24, 2021"
},
...
],
"serpapi_pagination": {
"next": "https://serpapi.com/search.json?all_reviews=true&engine=google_play_product&gl=us&hl=en&next_page_token=CpEBCo4BKmgKR_8AwEEujFG0VLQA___-9zuazVT_jmsbmJ6WnsXPz8_Pz8_PxsfJx5vJns3Gxc7FiZLFxsrLysnHx8rIx87Mx8nNzsnLyv_-ECghlTCOpBLShpdQAFoLCZiJujt_EovhEANgmOjCATIiCiAKHmFuZHJvaWRfaGVscGZ1bG5lc3NfcXNjb3JlX3YyYQ&product_id=com.google.android.youtube&store=apps",
"next_page_token": "CpEBCo4BKmgKR_8AwEEujFG0VLQA___-9zuazVT_jmsbmJ6WnsXPz8_Pz8_PxsfJx5vJns3Gxc7FiZLFxsrLysnHx8rIx87Mx8nNzsnLyv_-ECghlTCOpBLShpdQAFoLCZiJujt_EovhEANgmOjCATIiCiAKHmFuZHJvaWRfaGVscGZ1bG5lc3NfcXNjb3JlX3YyYQ"
}
Check out the documentation for more details.
Test the search live on the playground.
Disclaimer: I work at SerpApi.

Azure Cognitive Services - Batch Transcription API responds with error message "The recording URI is invalid."

Steps Followed:
I created a speech services instance in West US.
I have the right headers(Content-Type and Ocp-Apim-Subscription-Key)
I make a POST request to https://westus.cris.ai/api/speechtotext/v2.0/transcriptions/ with below request payload
{
"recordingsUrl": "https://transcribehm97c1.blob.core.windows.net/audio-files/2019-04-04_Blockchain%20explained%20with%20TruStory%27s%20Preethi%20Kasireddy.mp3?st=2019-05-27T12%3A19%3A27Z&se=2019-12-31T12%3A19%3A00Z&sp=rl&sv=2018-03-28&sr=b&sig=HFBvGl1pmCM95MNU9U3yniMNXrUMT6RmPb36F32cxrY%3D",
"models": [],
"locale": "en-US",
"name": "I dont know why this is not working",
"description": "Someone please send help",
"properties": {
"ProfanityFilterMode": "Masked",
"PunctuationMode": "DictatedAndAutomatic"
}
}
I get a “202 Accepted” response with below headers. This confirms that the request body is valid.
location: https://westus.cris.ai/api/speechtotext/v2.0/transcriptions/69b7abf4-6383-4490-88a9-9fd42a77e470
When I make a GET Request to the above location, I see this
{
"recordingsUrl": "https://transcribehm97c1.blob.core.windows.net/audio-files/2019-04-04_Blockchain explained with TruStory's Preethi Kasireddy.mp3?st=2019-05-27T12:19:27Z&se=2019-12-31T12:19:00Z&sp=rl&sv=2018-03-28&sr=b&sig=HFBvGl1pmCM95MNU9U3yniMNXrUMT6RmPb36F32cxrY%3D",
"resultsUrls": {},
"models": [“I have removed this for brevity”],
"statusMessage": "The recordings URI is invalid.",
"id": "69b7abf4-6383-4490-88a9-9fd42a77e470",
"createdDateTime": "2019-05-27T12:43:39Z",
"lastActionDateTime": "2019-05-27T12:43:50Z",
"status": "Failed",
"locale": "en-US",
"name": "I dont know why this is not working",
"description": "Someone please send help",
"properties": {
"ProfanityFilterMode": "Masked",
"PunctuationMode": "DictatedAndAutomatic"
}
}
The transcriptions fails for some URL's while passing for others for blobs in the same storage although they are all valid URL’s. The SAS URI in the request is valid till end of the
year.
I have re-tried the same request multiple times via code and Postman and it fails.
Link to Swagger Page : https://westus.cris.ai/swagger/ui/index
The issue may be due to the audio file size. Please refer the core features for REST API as the REST support only short Audio.

Facebook Ads API /adcreatives video error

My team and I have been crawling both the net and Facebook Docs for answers, but for some reason there are no valid answers to our question.
So we desperately hope for help from someone here
We are trying to create a video AD on facebook. Upload is done and we are at the step where we need to create the creative through /adcreatives endpoint.
Below is the body of the POST :
https://graph.facebook.com/v2.8/act_[account_id]/adcreatives
{
"access_token": "token_that_is_valid",
"object_story_spec": {
"page_id": "valid_numeric_page_id",
"video_data":{
"image_url": "link_to_img",
"video_id": "valid_numeric_video_id",
"call_to_action" :{
"type": "LEARN_MORE",
"value":{
"link": "my_link",
"link_caption":"my_link_caption",
"link_description": "description"
}
}
}
},
"name":"jjkkllkjljl"
}
The response from facebook is rather worrying :
{
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1487390,
"is_transient": false,
"error_user_title": "Adcreative Create Failed",
"error_user_msg": "The Adcreative Create Failed for the following reason: Oops, something went wrong. Please try again later",
"fbtrace_id": "EVL6GYOOtYi"
}
}
Also as an extra info, creating both non-video / image creatives and herafter ads is not an issue. Posting pre uploaded videos to a page is NOT an issue. All access rights has been given to the Facebook APP.
Thank you for taking the time to look at this.
I've the same problem with Python.
To fix it you shouldn't use video_id from admin panel.screenshot from admin panel
You should upload video and get video_id from API.
Example Python code:
video = AdVideo(parent_id=ad_account_id)
video[AdVideo.Field.filepath] = 'test.mp4'
video.remote_create()
video_id_for_creative=video.get_id()
link description is not a valid parameter in the call_to_action value: https://developers.facebook.com/docs/marketing-api/reference/ad-creative-link-data-call-to-action-value/

Resources