How can I get YouTube video's file name?

77 views
Skip to first unread message

Yoshimasa Tanabe

unread,
Jan 29, 2019, 7:41:59 AM1/29/19
to AdWords API and Google Ads API Forum
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

Thanet Knack Praneenararat (AdWords API Team)

unread,
Jan 31, 2019, 2:17:40 AM1/31/19
to AdWords API and Google Ads API Forum
Hello Tanabe,

I'll check with Engineering and get back to you soon.

Best,
Thanet, AdWords API Team

Yoshimasa Tanabe

unread,
Feb 11, 2019, 7:53:16 PM2/11/19
to AdWords API and Google Ads API Forum
Hi Thanet,

Has there been any news about sourceUrl?

Thanks!

---

Yoshimasa

googleadsapi...@google.com

unread,
Feb 12, 2019, 11:27:18 PM2/12/19
to lanabe...@gmail.com, AdWords API and Google Ads API Forum
Hello Yoshimasa,

Unfortunately, no updates yet.
I'm following up this with Engineering.

Best,
Thanet, AdWords API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
 
You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
---
You received this message because you are subscribed to the Google Groups "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/845814d2-48a1-4866-8637-cde9a1613fa2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

googleadsapi...@google.com

unread,
Feb 14, 2019, 12:41:09 AM2/14/19
to lanabe...@gmail.com, AdWords API and Google Ads API Forum
Hello Yoshimasa,

It turns out that the sourceUrl will be populated for other cases like AUDIO and IMAGE, but not for VIDEO.

Best,
Thanet, AdWords API Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
On 02/12/19 07:53:16 lanabe...@gmail.com wrote:
--

Yoshimasa Tanabe

unread,
Feb 14, 2019, 8:29:50 AM2/14/19
to AdWords API and Google Ads API Forum
Hi Thanet,

I appreciate you checking! 

So, is it not possible to get Videos' file name within AdWords API? 

If so, please let me know other solutions.

...

Yoshimasa

googleadsapi...@google.com

unread,
Feb 14, 2019, 8:47:59 AM2/14/19
to lanabe...@gmail.com, AdWords API and Google Ads API Forum
Hello Yoshimasa,

You're correct. It's not supported in the AdWords API, and unfortunately probably there are no workarounds for this.

Cheers,
Thanet, AdWords API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Yoshimasa Tanabe

unread,
Feb 14, 2019, 9:02:16 AM2/14/19
to AdWords API and Google Ads API Forum
Thanks!

Let me confirm one thing just to make sure.

It looks like you can get video's file name via YouTube Data API(fileDetails.fileName property). 


Is there any integration between AdWords API and YouTube Data API(e.g. adding YouTube Data API scope in OAuth2 flow)?

googleadsapi...@google.com

unread,
Feb 14, 2019, 9:55:55 AM2/14/19
to lanabe...@gmail.com, AdWords API and Google Ads API Forum
Hi,

No, there are no integration between the two APIs.

Best,
Thanet, AdWords API Team
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    http://googleadsdeveloper.blogspot.com/search/label/adwords_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Reply all
Reply to author
Forward
0 new messages