Download .mp4 from Google Photo using Google Drive API will get wrong md5Checksum - google-api

When we try to download a file with an extension of .mp4 from Google Photo using Google Drive API, the downloaded file always has different md5 hash value with the md5Checksum field provided by remote metadata.
For example, assume there exists a file name video.mp4 on Google Photo. After we download the file using either one of the following URL:
(v2) https://doc-14-6c-docs.googleusercontent.com/docs/securesc/[SOME_VALUES]?h=[SOME_VALUES]&e=download&gd=true
(v3) https://www.googleapis.com/drive/v3/files/[FILEID]?alt=media
Both methods will download the file correctly on a local machine. The file size is also the same as the fileSize field of remote metadata.
However, the md5 hash value is inconsistent with the md5Checksum field of remote metadata. For example, if we enter $md5sum video.mp4 command, we may got 5cf9fb1bb88dc9bf38d1de5c9180dc4e video.mp4. This is not the hash recorded at remote metadata.
All other files work fine (size and hash are consistent), except for the files with an extension of .mp4. By the way, we use CURL to send a request to Google Drive API to download these files, instead of using any of Google Drive SDK.
Hope someone can help us, thanks!
[Update] more explanation
These files are from our customer's Google Photo. We don't know the exact way to reproduce such situaion. We provide the metadata of one of problematic file for your reference. (we remove some private information.)
{
"kind": "drive#file",
"id": "(REMOVED)",
"etag": "(REMOVED)",
"selfLink": "(REMOVED)",
"webContentLink": "(REMOVED)",
"alternateLink": "(REMOVED)",
"embedLink": "(REMOVED)",
"iconLink": "(REMOVED)",
"thumbnailLink": "(REMOVED)",
"title": "(REMOVED)",
"mimeType": "video/mp4",
"description": "",
"labels": {
"starred": false,
"hidden": false,
"trashed": false,
"restricted": false,
"viewed": false
},
"createdDate": "2016-10-10T11:42:25.000Z",
"modifiedDate": "2016-10-18T23:01:19.000Z",
"modifiedByMeDate": "2016-10-18T23:01:19.000Z",
"markedViewedByMeDate": "1970-01-01T00:00:00.000Z",
"version": "133589",
"parents": [
{
"kind": "drive#parentReference",
"id": "(REMOVED)",
"selfLink": "(REMOVED)",
"parentLink": "(REMOVED)",
"isRoot": false
}
],
"downloadUrl": "(REMOVED)",
"userPermission": {
"kind": "drive#permission",
"etag": "(REMOVED)",
"id": "me",
"selfLink": "(REMOVED)",
"role": "owner",
"type": "user"
},
"originalFilename": "(REMOVED)",
"fileExtension": "mp4",
"md5Checksum": "c5a208198614c34b6fc61186d025df77",
"fileSize": "15284923",
"quotaBytesUsed": "0",
"ownerNames": [
"(REMOVED)"
],
"owners": [
{
"kind": "drive#user",
"displayName": "(REMOVED)",
"picture": {
"url": "(REMOVED)"
},
"isAuthenticatedUser": true,
"permissionId": "(REMOVED)",
"emailAddress": "(REMOVED)"
}
],
"lastModifyingUserName": "(REMOVED)",
"lastModifyingUser": {
"kind": "drive#user",
"displayName": "(REMOVED)",
"picture": {
"url": "(REMOVED)"
},
"isAuthenticatedUser": true,
"permissionId": "(REMOVED)",
"emailAddress": "(REMOVED)"
},
"capabilities": {
"canCopy": true,
"canEdit": true
},
"editable": true,
"copyable": true,
"writersCanShare": true,
"shared": false,
"explicitlyTrashed": false,
"appDataContents": false,
"headRevisionId": "(REMOVED)",
"videoMediaMetadata": {
"width": 720,
"height": 1280,
"durationMillis": "43697"
},
"spaces": [
"photos",
"drive"
]}
As you can see, the md5Checksum field shows c5a208198614c34b6fc61186d025df77 in the metadata. However, the actual md5 hash value equals to 95be52d721e2f5d8d02650b27095d466 instead.

Related

Manifest parsing error when trying to test app in Teams

From https://dev.teams.microsoft.com/, whenever I click "Preview in Teams", it shows an error in Teams with these details copied to the clipboard: "Error while reading manifest.json". If I download the app package and "upload a custom app" I get the same error. What can I do to resolve this? If I remove the messaging extension configuration, it works but I configured that part in their app and that's what I want to build.
This is my manifest file:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json",
"version": "1.0.0",
"manifestVersion": "1.11",
"id": "3fXXXX",
"packageName": "com.package.name",
"name": {
"short": "Domo Integration",
"full": ""
},
"developer": {
"name": "Domo Inc.",
"mpnId": "",
"websiteUrl": "https://www.domo.com",
"privacyUrl": "https://www.domo.com/company/privacy-policy",
"termsOfUseUrl": "https://www.domo.com/company/service-terms"
},
"description": {
"short": "short",
"full": "full"
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#FFFFFF",
"composeExtensions": [
{
"botId": "deXXXXXXXX",
"commands": [],
"canUpdateConfiguration": true,
"messageHandlers": [
{
"type": "link",
"value": {
"domains": [
"*.domo.com"
]
}
}
]
}
],
"validDomains": [
"*.domo.com"
]
}
#ccnokes In order to use messaging extension in your bot, you need to provide at least one command. commands is required property in composeExtension - see doc.
I was also getting the same error when tried with your manifest but after adding commands it worked totally fine.

Attempt to install new bot apps for Teams yields generic error "Manifest Parsing has Failed"

Working with a new Microsoft Teams App (a Bot, built with the MS Bot Framework, and deployed to Azure). Whether using the soon-to-be-deprecated App Studio, or the soon-to-replace-it Preview of the Developer Portal, attempting to install directly or to download the manifest and sideload to teams, in every case the following image is displayed:
The message "Manifest parsing has failed" is quite unhelpful. I am mystified that Microsoft is not supplying some additional information about WHAT failed. Is there a log file somewhere that I can find the actual problem?
UPDATE RESPONDING TO COMMENTS:
One kind commenter pointed me to a similar SO question, but the suggested solution (setting manfestVersion from that currently generated at 1.9 to 1.7) did not work. Behavior was identical.
Another commenter asked me to provide the manifest scrubbed of identifying information. Here it is:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.9/MicrosoftTeams.schema.json",
"version": "1.0.0",
"manifestVersion": "1.9",
"id": "VALID-GUID",
"packageName": "com.package.name",
"name": {
"short": "Stephan Trial App",
"full": ""
},
"developer": {
"name": "Valid Company",
"mpnId": "Correct mpnId",
"websiteUrl": "https://www.thiscompany.com",
"privacyUrl": "https://www.thiscompany.com/legal/privacy-policy/",
"termsOfUseUrl": "https://www.thiscompany.com/legal/terms-of-use/"
},
"description": {
"short": "Stephan's App's Short Description",
"full": "Stephan's App's Longer Description"
},
"icons": {
"outline": "outline.png",
"color": "color.png"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "VALID-CORRECT-GUID",
"scopes": [
"team",
"personal"
],
"isNotificationOnly": false,
"supportsFiles": false
}
],
"composeExtensions": [
{
"botId": "SAME-VALID-CORRECT-GUID-AS-BOT-ABOVE",
"commands": [
{
"id": "CmdID",
"type": "query",
"title": "Command Title",
"description": "Command Description",
"initialRun": true,
"fetchTask": false,
"context": [
"commandBox",
"compose",
"message"
],
"parameters": [
{
"name": "ParmID",
"title": "Parameter Title",
"description": "Parameter Description",
"inputType": "Text",
"choices": []
}
]
}
],
"canUpdateConfiguration": true,
"messageHandlers": []
}
],
"validDomains": [],
"devicePermissions": [
"geolocation"
]
}
I think I found the problem. Within composeExtensions > commands > parameters you have inputType but it's set to 'Text' (capital T) which is invalid - it needs to be 'text' (small 't'). Try that and it should be fine.

passing more information to consul watch handler

I am wondering whether consul watch handler can be passed some dynamic information while it's called.
That means watch mechanism can pass the script more arguments instead of my given arguments like the below example.
{
"watches": [
{
"type": "service",
"args": ["/tmp/dosomething.sh", "how can i get responses from /v1/health/service here"]
}
]
}
By the way, when I want to 'watch' a service, the most important info to me is the service's state(passing or critial), but I don't understand:
when watch type is 'service', why I cannot appoint the 'service'.
when watch type is 'checks', why I cannot appoint state and service concurrently.
consul watch passes the entire API response payload as an argument to the watch handler script. Your script needs to be able to consume and parse the JSON, and then act on the data provided.
When you watch a service, the data returned is from the /v1/health/service/:service endpoint. (See consul/api/watch/funcs.go.)
when watch type is 'service', why I cannot appoint the 'service'.
I assume you mean that you would like to watch a specific service. If so, this is supported. You can specify a specific service to watch using the -service flag. For example, consul watch -type=service -service=assets.
when watch type is 'checks', why I cannot appoint state and service concurrently.
If you're interested in monitoring checks for a particular service, you should just use the aforementioned watch command for a specific service. The service check information is included in the API response.
$ consul watch -type=service -service=assets
[
{
"Node": {
"ID": "f013522f-aaa2-8fc6-c8ac-c84cb8a56405",
"Node": "hashicorp-consul-server-2",
"Address": "10.0.0.82",
"Datacenter": "dc2",
"TaggedAddresses": null,
"Meta": null,
"CreateIndex": 22898191,
"ModifyIndex": 22898191
},
"Service": {
"ID": "assets-v1",
"Service": "assets",
"Tags": [],
"Meta": null,
"Port": 9090,
"Address": "",
"Weights": {
"Passing": 1,
"Warning": 1
},
"EnableTagOverride": false,
"CreateIndex": 22898195,
"ModifyIndex": 22898195,
"Proxy": {
"MeshGateway": {},
"Expose": {}
},
"Connect": {}
},
"Checks": [
{
"Node": "hashicorp-consul-server-2",
"CheckID": "serfHealth",
"Name": "Serf Health Status",
"Status": "passing",
"Notes": "",
"Output": "Agent alive and reachable",
"ServiceID": "",
"ServiceName": "",
"ServiceTags": [],
"Type": "",
"Definition": {
"Interval": "0s",
"Timeout": "0s",
"DeregisterCriticalServiceAfter": "0s",
"HTTP": "",
"Header": null,
"Method": "",
"Body": "",
"TLSServerName": "",
"TLSSkipVerify": false,
"TCP": ""
},
"CreateIndex": 22898191,
"ModifyIndex": 22898191
}
]
}
]

Microsoft Teams: Messaging Extension with Search-based commands

I'm testing Teams Messaging Extension for Search-based commands. After creating solution with "YO TEAMS" and creating BOT in Azure with BotId / AppId and password / Secret. And put these as values in .env file in solution.
By running the command "gulp ngrok-serve" I get ngrok url generated and things look like it should be fine. But by uploading a .zip file from the package folder in Teams, I get the error message "Unable to reach app, Please try again".
Just to test, I have created another solution with only "Tab". And I get almost the same error message when I try to upload .zip,
"There was a problem reaching this app"
There are many frustrating tutorials some old and some new. By running the command "gulp ngrok-serve" you start ngrok for tunnel. And ngrok URL that is generated seems to work:
And the URL is stored as an endpoint for BOT in Azure:
So what have I missed here since it does not work?
Here is my manifest file:
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.6/MicrosoftTeams.schema.json",
"manifestVersion": "1.6",
"id": "{{APPLICATION_ID}}",
"version": "{{VERSION}}",
"packageName": "{{PACKAGE_NAME}}",
"developer": {
"name": "gonadn consulting",
"websiteUrl": "https://{{HOSTNAME}}",
"privacyUrl": "https://{{HOSTNAME}}/privacy.html",
"termsOfUseUrl": "https://{{HOSTNAME}}/tou.html"
},
"name": {
"short": "TeamsMsgExtSearch",
"full": "TeamsMsgExtSearch"
},
"description": {
"short": "TODO: add short description here",
"full": "TODO: add full description here"
},
"icons": {
"outline": "icon-outline.png",
"color": "icon-color.png"
},
"accentColor": "#D85028",
"configurableTabs": [],
"staticTabs": [],
"bots": [],
"connectors": [],
"composeExtensions": [
{
"botId": "{{MICROSOFT_APP_ID}}",
"canUpdateConfiguration": false,
"commands": [
{
"id": "msgSearchCommandMessageExtension",
"title": "MsgSearchCommand",
"description": "Add a clever description here",
"initialRun": true,
"parameters": [
{
"name": "parameter",
"description": "Description of the parameter",
"title": "Parameter"
}
],
"type": "query"
}
]
}
],
"permissions": [
"identity",
"messageTeamMembers"
],
"validDomains": [
"{{HOSTNAME}}"
],
"showLoadingIndicator": false
}
Link to Git Repo

Guest can't submit answer Adaptative Card on Microsoft Teams

I'm having an error with a custom bot when I send an adaptative card to a meeting and a guest tries to submit an answer. It works when a logged user tries to submit it. It used to work perfectly with a Guest. It seems like the problem is something about the bot login process.
Uncaught TypeError: Cannot read property '*BotId*' of undefined
at t.recordBotMriUsage (3.2-app.min-2477809.js:4)
at _.debounce.trailing (3.2-app.min-2477809.js:3)
at e (2-vendor.min-9ae85bb.js:64)
at f (2-vendor.min-9ae85bb.js:65)
at t.e.buttonClicked (3.2-app.min-2477809.js:3)
at o (lazy-ng1-mod-adaptive-card-components.min-1b02b78.js:1)
at c (lazy-ng1-mod-adaptive-card-components.min-1b02b78.js:1)
at t.handleOnExecuteAction (lazy-ng1-mod-adaptive-card-components.min-1b02b78.js:1)
at adaptiveCard.onExecuteAction (lazy-ng1-mod-adaptive-card-components.min-1b02b78.js:1)
at p (3.2-app.min-2477809.js:3)
Failed to get app entitlement for botId 28:*BotId*
500 Invoke failed due to internal error: Invoke failed: something went wrong in ProcessInvoke
[BotCardService::onButtonClicked_messageback()] sendInvoke failed: {"statusCode":500,"headers":{"cache-control":"no-store, must-revalidate, no-cache","content-length":"119","content-type":"application/json; charset=utf-8","contextid":"tcid=******,server=*****,cv=*******/hfA.1.0","pragma":"no-cache","set-registrationtoken":"**redacted**"},"errorMessage":"Error Code: 500 ","errorCode":500,"request":{}}
error log
EDIT: Here is the manifest.json of the app
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.7/MicrosoftTeams.schema.json",
"manifestVersion": "1.7",
"version": "1.0.0",
"id": "redacted",
"packageName": "redacted",
"developer": {
"name": "redacted",
"websiteUrl": "redacted",
"privacyUrl": "redacted",
"termsOfUseUrl": "redacted"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "redacted",
"full": "redacted"
},
"description": {
"short": "redacted",
"full": "redacted"
},
"accentColor": "#FFFFFF",
"bots": [
{
"botId": "redacted",
"scopes": ["personal", "groupchat"],
"supportsFiles": false,
"isNotificationOnly": false
}
],
"composeExtensions": [
{
"botId": "redacted",
"canUpdateConfiguration": true,
"commands": [
{
"id": "getPollCM",
"type": "action",
"title": "Generar encuesta prestador",
"description": "Genera una encuesta para prestadores",
"initialRun": true,
"fetchTask": false,
"context": ["commandBox", "compose"],
"parameters": [
{
"name": "NIT",
"title": "NIT del prestador",
"description": "Solo nĂºmeros",
"inputType": "text"
}
]
}
]
}
],
"permissions": ["identity", "messageTeamMembers"],
"validDomains": ["redacted"]
}

Resources