Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

regionCode not working consistently properly, YouTube API, Google App Script

Extracting some data from YouTube API using Google Apps Script, in multiple regions using the following code:

var regions = ['SA','EG','DZ','IQ','JO','KW','LB','LY','MA','OM','YE','AE','BH','QA','TN']; //EG, LY, YE, do not work!
  
sr = YouTube.Videos.list("snippet,id", {chart: "mostPopular", regionCode: regions[i], maxResults:50});

Works properly in all mentioned regions array, except EG , LY and YE, while only changing the regionCode variable.

The code is ISO 3166-1 alpha-2, I am sure the country code is correct. Is there anything I might be missing?

EDIT --- I have re-submitted the issue on Issue Tracker, and it has been assigned.

EDIT -- "This is known issue. Unfortunately, we don't have ETA for the fix."

like image 782
Eslam Rady Avatar asked Sep 16 '26 05:09

Eslam Rady


1 Answers

This appears to be a bug!

There is already a report on Google's Issue Tracker which detail the same kind of behaviour:

  • Videos listing doesn't return data for certain countries

You can hit the ☆ next to the issue number in the top left on the aforementioned page which lets Google know more people are encountering this and so it is more likely to be seen to faster.

like image 193
I hope this is helpful to you Avatar answered Sep 17 '26 20:09

I hope this is helpful to you



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!