Hi,
Is there any way to get YouTube video's original file name(like foo.mp4) the user uploaded?
I referred the API doc[1] and found the following fields look like related.
* sourceUrl: The URL of where the original media was downloaded from (or a file name).
* name: The name of the media. The name can be used by clients to help identify previously uploaded media.
But I get the Video object has the empty sourceUrl and the name is Video(YouTube) title, not the file name.
{
name=<This is Video title, not the file name>,
sourceUrl=, // empty
// other fields
...
}
Am I missing something?
...
Code snippet is here(Scala).
* "com.google.api-ads" % "ads-lib" % 4.1.0
* "com.google.api-ads" % "adwords-axis" % 4.1.0
import com.google.api.ads.adwords.axis.factory.AdWordsServices
import com.google.api.ads.adwords.axis.utils.v201806.SelectorBuilder
import com.google.api.ads.adwords.axis.v201806.cm.MediaServiceInterface
import com.google.api.ads.adwords.lib.client.AdWordsSession
import com.google.api.ads.adwords.lib.selectorfields.v201806.cm.MediaField
val mediaServiceSelector = new SelectorBuilder()
.fields(
MediaField.MediaId,
MediaField.YouTubeVideoIdString,
MediaField.Name,
MediaField.SourceUrl,
MediaField.StreamingUrl
)
.in(MediaField.Type, "VIDEO")
.build()
val session = new AdWordsSession.Builder()
.withOAuth2Credential(<credential>)
.withDeveloperToken(<developerToken>)
.withClientCustomerId(<target_client_customer_id>)
.build()
AdWordsServices.getInstance()
.get(session, classOf[MediaServiceInterface])
.get(mediaServiceSelector)
---
Yoshimasa