Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get information about bus stop using YandexTransportProxy + YandexTransportWebdriverAPI-Python - Exception: Exception(_single_query_blocking): Yandex Transport Proxy Server signalled an error: No Yandex Masstransit API data received for method getStopInfo #4

Open
Yrok472 opened this issue May 2, 2020 · 7 comments

Comments

@Yrok472
Copy link

Yrok472 commented May 2, 2020

Hi

I'm trying to repeat an example from readme:

proxy = YandexTransportProxy('<my ip of the vps with running YandexTransportProxy  inside docker>', 25555)
url = "https://yandex.ru/maps/213/moscow/?ll=37.742975%2C55.651185&masstransit%5BstopId%5D=stop__9647487&mode=stop&z=18"
data = proxy.get_stop_info(url)

After that i got next exception:

>>> data = proxy.get_stop_info(url)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\yandex_transport_webdriver_api\yandex_transport_proxy.py", line 303, in get_stop_info
    result = self._execute_get_query('getStopInfo', url, query_id, blocking, timeout, callback)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\yandex_transport_webdriver_api\yandex_transport_proxy.py", line 222, in _execute_get_query
    result =  self._single_query_blocking(sock, command)
  File "C:\Program Files (x86)\Python37-32\lib\site-packages\yandex_transport_webdriver_api\yandex_transport_proxy.py", line 144, in _single_query_blocking
    "Yandex Transport Proxy Server signalled an error: " + json_data['message'])
Exception: Exception(_single_query_blocking): Yandex Transport Proxy Server signalled an error: No Yandex Masstransit API data received for method getStopInfo from URL "https://yandex.ru/maps/213/moscow/?ll=37.742975%2C55.651185&masstransit%5BstopId%5D=stop__9647487&mode=stop&z=18"

I'm running YandexTransportWebdriverAPI-Python by recommended way - docker variant (latest tag).

@Yrok472
Copy link
Author

Yrok472 commented May 2, 2020

Если не возбраняется, то можно на русском :)

@Yrok472
Copy link
Author

Yrok472 commented Nov 29, 2020

@OwlSoul Проблема все еще актуальна

2020-11-29T13:43:39.197137826Z DEBUG : [2020-11-29 16:43:39.196943] : Executing getStopInfo query: ID=87510134-ef43-4b49-8ef8-231cb502b9bc Body=https://yandex.ru/maps/213/moscow/?ll=37.742975%2C55.651185&masstransit%5BstopId%5D=stop__9647487&mode=stop&z=18
2020-11-29T13:43:41.323965178Z JSON Exception (_get_yandex_json): Expecting value: line 1 column 46556 (char 46555)
2020-11-29T13:43:41.324025619Z DEBUG : [2020-11-29 16:43:41.323863] : Writing to ytproxy-network.log (315 bytes) 

Если я правильно вижу, мы пытаемся сходить и узнать что отдается по maps/api/masstransit/getStopInfo:

Посмотрел через бразуер руками, сейчас там так:
https://yandex.ru/maps/api/masstransit/getStopInfo?ajax=1&csrfToken=<token>&id=stop__9647487&lang=ru&locale=ru_RU&mode=prognosis&s=4279109786&sessionId=1606655974264_240277

Данные при этом отдаются в таком виде:
{"data":{"id":"stop__9647487","name":"Метро Марьино (северная)","coordinates":[37.742991076,55.651473063],"currentTime":1606656005122,"tzOffset":10800,"type":"urban","region":{"id":213,"type":6,"parent_id":1,"capital_id":0,"geo_parent_id":0,"city_id":213,"name":"Москва","native_name":"","iso_name":"RU MOW","is_main":true,"en_name":"Moscow","short_en_name":"MSK","phone_code":"495 499","phone_code_old":"095","zip_code":"","population":12506468,"synonyms":"Moskau, Moskva","latitude":55.753215,"longitude":37.622504,"latitude_size":0.878654,"longitude_size":1.164423,"zoom":10,"tzname":"Europe/Moscow","official_languages":"ru","widespread_languages":"ru","suggest_list":[],"is_eu":false,"services_names":["bs","yaca","weather","afisha","maps","tv","ad","etrain","subway","delivery","route"],"seoname":"moscow","bounds":[[37.0402925,55.31141404514547],[38.2047155,56.190068045145466]],"names":{"ablative":"","accusative":"Москву","dative":"Москве","directional":"","genitive":"Москвы","instrumental":"Москвой","locative":"","nominative":"Москва","preposition":"в","prepositional":"Москве"},"parent":{"id":1,"type":5,"parent_id":3,"capital_id":213,"geo_parent_id":0,"city_id":213,"name":"Москва и Московская область","native_name":"","iso_name":"RU-MOS","is_main":true,"en_name":"Moscow and Moscow Oblast","short_en_name":"RU-MOS","phone_code":"495 496 498 499","phone_code_old":"","zip_code":"","population":7503385,"synonyms":"Московская область, Подмосковье, Podmoskovye","latitude":55.815792,"longitude":37.380031,"latitude_size":2.705659,"longitude_size":5.060749,"zoom":8,"tzname":"Europe/Moscow","official_languages":"ru","widespread_languages":"ru","suggest_list":[213,10716,10747,10758,20728,10740,10738,20523,10735,10734,10743,21622],"is_eu":false,"services_names":["bs","yaca","ad"],"seoname":"moscow-and-moscow-oblast","bounds":[[34.8496565,54.439456064325434],[39.9104055,57.14511506432543]],"names":{"ablative":"","accusative":"Москву и Московскую область","dative":"Москве и Московской области","directional":"","genitive":"Москвы и Московской области","instrumental":"Москвой и Московской областью","locative":"","nominative":"Москва и Московская область","preposition":"в","prepositional":"Москве и Московской области"},"parent":{"id":225,"type":3,"parent_id":10001,"capital_id":213,"geo_parent_id":0,"city_id":213,"name":"Россия","native_name":"","iso_name":"RU","is_main":false,"en_name":"Russia","short_en_name":"RU","phone_code":"7","phone_code_old":"","zip_code":"","population":146880432,"synonyms":"Russian Federation,Российская Федерация","latitude":61.698653,"longitude":99.505405,"latitude_size":40.700127,"longitude_size":171.643239,"zoom":3,"tzname":"","official_languages":"ru","widespread_languages":"ru","suggest_list":[213,2,65,54,47,43,66,51,56,172,39,62],"is_eu":false,"services_names":["bs","yaca","ad"],"seoname":"russia","bounds":[[13.683785499999999,35.290400699917846],[-174.6729755,75.99052769991785]],"names":{"ablative":"","accusative":"Россию","dative":"России","directional":"","genitive":"России","instrumental":"Россией","locative":"","nominative":"Россия","preposition":"в","prepositional":"России"}}}},"transports":[{"lineId":"2036924471","name":"511","Types":["bus"],"type":"bus","threads":[{"threadId":"6e5bA_511_bus_default","noBoarding":false,"EssentialStops":[{"id":"stop__9646126","name":"Метро Красногвардейская"},{"id":"stop__9646125","name":"Метро Красногвардейская"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606656315","tzOffset":10800,"text":"16:25"}},{"Scheduled":{"value":"1606656915","tzOffset":10800,"text":"16:35"}},{"Scheduled":{"value":"1606657515","tzOffset":10800,"text":"16:45"},"Estimated":{"value":"1606657229","tzOffset":10800,"text":"16:40"},"vehicleId":"moscow%5Fnew|38004"}],"Frequencies":[],"departureTime":"16:25"}}],"uri":"ymapsbm1://transit/line?id=2036924471&ll=37.756164%2C55.645209&name=511&r=3502&type=bus","seoname":"511"},{"lineId":"2036924477","name":"517","Types":["bus"],"type":"bus","threads":[{"threadId":"213A_517m_minibus_default","noBoarding":false,"EssentialStops":[{"id":"stop__9646211","name":"Метро Орехово"},{"id":"stop__9646191","name":"Метро Орехово"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606656617","tzOffset":10800,"text":"16:30"},"Estimated":{"value":"1606656120","tzOffset":10800,"text":"16:22"},"vehicleId":"moscow%5Fnew|35328"},{"Scheduled":{"value":"1606658417","tzOffset":10800,"text":"17:00"}},{"Scheduled":{"value":"1606660277","tzOffset":10800,"text":"17:31"}}],"Frequencies":[],"departureTime":"16:30"}}],"uri":"ymapsbm1://transit/line?id=2036924477&ll=37.735025%2C55.642035&name=517&r=4388&type=bus","seoname":"517"},{"lineId":"2036924593","name":"н5 (ночной)","Types":["bus"],"type":"bus","threads":[{"threadId":"N5G_bus_default","noBoarding":false,"EssentialStops":[{"id":"stop__10187979","name":"Метро Китай-город"},{"id":"stop__9649035","name":"Каширское шоссе, 148"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606690440","tzOffset":10800,"text":"01:54"}},{"Scheduled":{"value":"1606692240","tzOffset":10800,"text":"02:24"}},{"Scheduled":{"value":"1606694040","tzOffset":10800,"text":"02:54"}}],"Frequencies":[],"departureTime":"01:54"}}],"uri":"ymapsbm1://transit/line?id=2036924593&ll=37.679646%2C55.675173&name=%D0%BD5&r=9258&type=bus","seoname":"n5"},{"lineId":"2036925691","name":"Ашан - Братиславская","Types":["bus"],"type":"bus","threads":[{"threadId":"2036927530","noBoarding":false,"EssentialStops":[{"id":"stop__9648350","name":"Братиславская улица"},{"id":"stop__10130286","name":"ТЦ Ашан"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606658002","tzOffset":10800,"text":"16:53"}},{"Scheduled":{"value":"1606661602","tzOffset":10800,"text":"17:53"}},{"Scheduled":{"value":"1606665202","tzOffset":10800,"text":"18:53"}}],"Frequencies":[],"departureTime":"16:53"}}],"uri":"ymapsbm1://transit/line?id=2036925691&ll=37.758911%2C55.643877&name=%D0%90%D1%88%D0%B0%D0%BD+-+%D0%91%D1%80%D0%B0%D1%82%D0%B8%D1%81%D0%BB%D0%B0%D0%B2%D1%81%D0%BA%D0%B0%D1%8F&r=2150&type=bus","seoname":"Ashan___Bratislavskaya"},{"lineId":"2036925719","name":"Южные Ворота - Братиславская","Types":["minibus"],"type":"minibus","threads":[{"threadId":"2036926754","noBoarding":false,"EssentialStops":[{"id":"stop__9711671","name":"Метро Братиславская"},{"id":"2048013040","name":"ТК Южные Ворота"}],"BriefSchedule":{"Events":[],"Frequencies":[{"text":"30 мин.","value":1800,"begin":{"value":"1606617318","tzOffset":10800,"text":"05:35"},"end":{"value":"1606662318","tzOffset":10800,"text":"18:05"}}]}}],"uri":"ymapsbm1://transit/line?id=2036925719&ll=37.764778%2C55.639044&name=%D0%AE%D0%B6%D0%BD%D1%8B%D0%B5+%D0%92%D0%BE%D1%80%D0%BE%D1%82%D0%B0+-+%D0%91%D1%80%D0%B0%D1%82%D0%B8%D1%81%D0%BB%D0%B0%D0%B2%D1%81%D0%BA%D0%B0%D1%8F&r=2410&type=minibus","seoname":"YUzhnie_Vorota___Bratislavskaya"},{"lineId":"2036926321","name":"415","Types":["bus"],"type":"bus","threads":[{"threadId":"f254A_415_bus_default","noBoarding":false,"EssentialStops":[{"id":"stop__9645762","name":"Метро Каширская"},{"id":"stop__9646269","name":"Метро Каширская"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606656519","tzOffset":10800,"text":"16:28"},"Estimated":{"value":"1606656031","tzOffset":10800,"text":"16:20"},"vehicleId":"moscow%5Fnew|38385"},{"Scheduled":{"value":"1606657239","tzOffset":10800,"text":"16:40"},"Estimated":{"value":"1606657166","tzOffset":10800,"text":"16:39"},"vehicleId":"moscow%5Fnew|38308"},{"Scheduled":{"value":"1606657959","tzOffset":10800,"text":"16:52"}}],"Frequencies":[],"departureTime":"16:28"}}],"uri":"ymapsbm1://transit/line?id=2036926321&ll=37.713431%2C55.663586&name=415&r=4100&type=bus","seoname":"415"},{"lineId":"2036926377","name":"Южные Ворота – Марьино","Types":["minibus"],"type":"minibus","threads":[{"threadId":"2036927149","noBoarding":false,"EssentialStops":[{"id":"stop__9647487","name":"Метро Марьино (северная)"},{"id":"2048013040","name":"ТК Южные Ворота"}],"BriefSchedule":{"Events":[],"Frequencies":[{"text":"12 мин.","value":720,"begin":{"value":"1606617000","tzOffset":10800,"text":"05:30"},"end":{"value":"1606662000","tzOffset":10800,"text":"18:00"}}]}}],"uri":"ymapsbm1://transit/line?id=2036926377&ll=37.762876%2C55.635695&name=%D0%AE%D0%B6%D0%BD%D1%8B%D0%B5+%D0%92%D0%BE%D1%80%D0%BE%D1%82%D0%B0+%E2%80%93+%D0%9C%D0%B0%D1%80%D1%8C%D0%B8%D0%BD%D0%BE&r=2155&type=minibus","seoname":"YUzhnie_Vorota___Marino"},{"lineId":"2036926807","name":"965","Types":["bus"],"type":"bus","threads":[{"threadId":"965B_bus_default","noBoarding":false,"EssentialStops":[{"id":"3265365007","name":"Рынок Садовод"},{"id":"stop__9646132","name":"14-й микрорайон Орехово-Борисова"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606657067","tzOffset":10800,"text":"16:37"},"Estimated":{"value":"1606656925","tzOffset":10800,"text":"16:35"},"vehicleId":"moscow%5Fnew|43174"},{"Scheduled":{"value":"1606658867","tzOffset":10800,"text":"17:07"}},{"Scheduled":{"value":"1606660667","tzOffset":10800,"text":"17:37"}}],"Frequencies":[],"departureTime":"16:37"}},{"threadId":"4132169466","noBoarding":false,"EssentialStops":[{"id":"stop__9646548","name":"Садовод"},{"id":"stop__9646132","name":"14-й микрорайон Орехово-Борисова"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606661938","tzOffset":10800,"text":"17:58"}},{"Scheduled":{"value":"1606663738","tzOffset":10800,"text":"18:28"}},{"Scheduled":{"value":"1606665238","tzOffset":10800,"text":"18:53"}}],"Frequencies":[],"departureTime":"17:58"}}],"uri":"ymapsbm1://transit/line?id=2036926807&ll=37.789319%2C55.632164&name=965&r=3972&type=bus","seoname":"965"},{"lineId":"2036926835","name":"541","Types":["bus"],"type":"bus","threads":[{"threadId":"213A_141m_minibus_default","noBoarding":false,"EssentialStops":[{"id":"stop__9644946","name":"Ставропольский проезд"},{"id":"stop__10049137","name":"Южные Ворота"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606656370","tzOffset":10800,"text":"16:26"},"Estimated":{"value":"1606656220","tzOffset":10800,"text":"16:23"},"vehicleId":"moscow%5Fnew|43173"},{"Scheduled":{"value":"1606657450","tzOffset":10800,"text":"16:44"}},{"Scheduled":{"value":"1606658530","tzOffset":10800,"text":"17:02"}}],"Frequencies":[],"departureTime":"16:26"}}],"uri":"ymapsbm1://transit/line?id=2036926835&ll=37.778436%2C55.649236&name=541&r=3160&type=bus","seoname":"541"},{"lineId":"2070378676","name":"1228к","Types":["minibus"],"type":"minibus","threads":[{"threadId":"2070379926","noBoarding":false,"EssentialStops":[{"id":"stop__9648895","name":"Люблинская улица, 96"},{"id":"stop__9686587","name":"Развилка, 38"}],"BriefSchedule":{"Events":[],"Frequencies":[{"text":"15 мин.","value":900,"begin":{"value":"1606620722","tzOffset":10800,"text":"06:32"},"end":{"value":"1606676522","tzOffset":10800,"text":"22:02"}}]}}],"uri":"ymapsbm1://transit/line?id=2070378676&ll=37.747681%2C55.623982&name=1228%D0%BA&r=4185&type=minibus","seoname":"1228k"},{"lineId":"213_280_bus_mosgortrans","name":"280","Types":["bus"],"type":"bus","threads":[{"threadId":"213A_280_bus_mosgortrans","noBoarding":false,"EssentialStops":[{"id":"stop__9648085","name":"Метро Каширская"},{"id":"stop__9646275","name":"Метро Каширская"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606657620","tzOffset":10800,"text":"16:47"}},{"Scheduled":{"value":"1606660920","tzOffset":10800,"text":"17:42"}},{"Scheduled":{"value":"1606664220","tzOffset":10800,"text":"18:37"}}],"Frequencies":[],"departureTime":"16:47"}}],"uri":"ymapsbm1://transit/line?id=213_280_bus_mosgortrans&ll=37.705275%2C55.666792&name=280&r=3943&type=bus","seoname":"280"},{"lineId":"213_623_bus_mosgortrans","name":"623","Types":["bus"],"type":"bus","threads":[{"threadId":"213A_623_bus_mosgortrans","noBoarding":false,"EssentialStops":[{"id":"stop__9646126","name":"Метро Красногвардейская"},{"id":"stop__9646125","name":"Метро Красногвардейская"}],"BriefSchedule":{"Events":[{"Scheduled":{"value":"1606656360","tzOffset":10800,"text":"16:26"},"Estimated":{"value":"1606656539","tzOffset":10800,"text":"16:28"},"vehicleId":"moscow%5Fnew|1170646"},{"Scheduled":{"value":"1606657260","tzOffset":10800,"text":"16:41"},"Estimated":{"value":"1606657001","tzOffset":10800,"text":"16:36"},"vehicleId":"moscow%5Fnew|1071185"},{"Scheduled":{"value":"1606658160","tzOffset":10800,"text":"16:56"}}],"Frequencies":[],"departureTime":"16:26"}}],"uri":"ymapsbm1://transit/line?id=213_623_bus_mosgortrans&ll=37.737634%2C55.660660&name=623&r=5154&type=bus","seoname":"623"}],"breadcrumbs":[{"name":"Карты","type":"root","url":"https://yandex.ru/maps/"},{"name":"Москва","type":"region","url":"https://yandex.ru/maps/213/moscow/","region":{"center":[37.622504,55.753215],"zoom":10}},{"name":"Общественный транспорт","type":"masstransit-home","url":"https://yandex.ru/maps/213/moscow/transport/"},{"name":"Метро Марьино (северная)","type":"search","url":"https://yandex.ru/maps/213/moscow/stops/stop__9647487/","currentPage":true}]}}

@OwlSoul
Copy link
Owner

OwlSoul commented Nov 29, 2020

Ребят, проект мертв, мне очень жаль. С приходом ковида нужда в транспорте отпала.

@Yrok472
Copy link
Author

Yrok472 commented Nov 29, 2020

@OwlSoul за что ты так :( Аналогичная история, просто хотелось pet-проект доделать. Был аналогичный велосипед, но у тебя выглядело лучше на порядок, хотел переехать на него..

@OwlSoul
Copy link
Owner

OwlSoul commented Jan 8, 2021

Немного некромансии =).

В общем проблема была у Яндекса, getStopInfo теперь при загрузки страницы дергается не сразу. Прикрутил костыль, ждем 30 секунд, и оно отдает все по хорошему как должно.

Yrok472 added a commit to Yrok472/YandexTransportProxy that referenced this issue Jan 8, 2021
@Yrok472
Copy link
Author

Yrok472 commented Jan 8, 2021

Пересобрал для себя docker образ, фикс действительно работает, правда костыль действительно костыль :(
Лучше чем ничего, спасибо!

@nekromant
Copy link

Ловлю такую же ошибку, если пытаюсь получить данные для станции МЦД. По ходу для МЦД это не работает.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants