As the questions says I deliberately asked this question in the same form that was already asked here on stackoverflow but it was 6 years ago and I wonder if there is any other better way to find all the countries that the routes goes through asides from answers in those questions:
Is it possible to get full list of countries within selected google maps route?
Google Maps Javascript API, DirectionsService, list of countries
Using Google Maps API or any other...