123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536 |
- import json
- from itertools import groupby
- # a = [
- # {'username': "dev_1009048", 'password': "e60be16cbfeebdb4d4c7dd7c0a6f2f67", 'nickname': "", 'avatar': ""},
- # {'username': "dev_1009049", 'password': "e60be16cbfeebdb4d4c7dd7c0a6f2f67", 'nickname': "", 'avatar': ""},
- # {'username': "dev_1009050", 'password': "e60be16cbfeebdb4d4c7dd7c0a6f2f67", 'nickname': "", 'avatar': ""}
- # ]
- # b = json.dumps(a)
- # print(b)
- hotel_arr = [
- {
- "Id" : 1179302758386278426,
- "ENName" : "Holiday Inn Resort Phuket, an IHG Hotel (SHA Extra Plus)"
- },
- {
- "Id" : 1179302758386278460,
- "ENName" : "The Okura Prestige Bangkok"
- },
- {
- "Id" : 1179302758386278467,
- "ENName" : "Ibis Styles Bangkok Ratchada"
- },
- {
- "Id" : 1179302758386278471,
- "ENName" : "Como Metropolitan Bangkok"
- },
- {
- "Id" : 1179302765696950370,
- "ENName" : "InterContinental Koh Samui Resort"
- },
- {
- "Id" : 1179302772906958871,
- "ENName" : "Wyndham Sea Pearl Resort, Phuket(SHA Extra Plus)"
- },
- {
- "Id" : 1179302780486066207,
- "ENName" : "Hotel M Chiang Mai"
- },
- {
- "Id" : 1179302795359068183,
- "ENName" : "Centara Grand & Bangkok Convention Centre at CentralWorld"
- },
- {
- "Id" : 1179302817517576243,
- "ENName" : "The Grass Serviced Suites"
- },
- {
- "Id" : 1179302824845025295,
- "ENName" : "Maduzi Hotel, Bangkok"
- },
- {
- "Id" : 1179302824845025300,
- "ENName" : "Pullman Bangkok Hotel G"
- },
- {
- "Id" : 1179302846760263731,
- "ENName" : "The Berkeley Hotel Pratunam Bangkok"
- },
- {
- "Id" : 1179302869254316118,
- "ENName" : "Stay with Nimman Chiang Mai"
- },
- {
- "Id" : 1179303117871685645,
- "ENName" : "Marina Gallery Resort-Kacha-Kalim Bay"
- },
- {
- "Id" : 1179303117871685649,
- "ENName" : "Wyndham Grand Nai Harn Beach Phuket"
- },
- {
- "Id" : 1179303163316969479,
- "ENName" : "Ascott Embassy Sathorn Bangkok"
- },
- {
- "Id" : 1179303163316969510,
- "ENName" : "Somerset Pattaya"
- },
- {
- "Id" : 1179303163316969514,
- "ENName" : "Sheraton Samui Resort"
- },
- {
- "Id" : 1179303163316969518,
- "ENName" : "W Koh Samui"
- },
- {
- "Id" : 1179303765497389121,
- "ENName" : "New Orient Landmark Hotel"
- },
- {
- "Id" : 1179303781356052503,
- "ENName" : "Rio Hotel"
- },
- {
- "Id" : 1179305771175813194,
- "ENName" : "The Macau Roosevelt"
- },
- {
- "Id" : 1179313280867409926,
- "ENName" : "Mitsui Garden Hotel Ginza-Gochome"
- },
- {
- "Id" : 1179313294817665048,
- "ENName" : "Four Seasons Hotel Kuala Lumpur"
- },
- {
- "Id" : 1179313294817665057,
- "ENName" : "Mitsui Garden Hotel Ueno"
- },
- {
- "Id" : 1179302758386278406,
- "ENName" : "Sindhorn Kempinski Bangkok"
- },
- {
- "Id" : 1179302758386278412,
- "ENName" : "Melia Phuket Mai Khao(SHA Extra Plus)"
- },
- {
- "Id" : 1179302758386278454,
- "ENName" : "Four Seasons Resort Chiang Mai"
- },
- {
- "Id" : 1179302758386278459,
- "ENName" : "Chatrium Grand Bangkok"
- },
- {
- "Id" : 1179302758386278469,
- "ENName" : "Ibis Styles Bangkok Sukhumvit Phra Khanong"
- },
- {
- "Id" : 1179302758386278483,
- "ENName" : "Anantara Chiang Mai Resort"
- },
- {
- "Id" : 1179302765696950292,
- "ENName" : "Twin Lotus Resort & Spa Koh Lanta(SHA Extra Plus)"
- },
- {
- "Id" : 1179302765696950360,
- "ENName" : "Novotel Phuket Kata Avista Resort and Spa"
- },
- {
- "Id" : 1179302772906958854,
- "ENName" : "Grand Mercure Phuket Patong(SHA Extra Plus)"
- },
- {
- "Id" : 1179302772906958874,
- "ENName" : "Shangri-La Hotel, Chiang Mai"
- },
- {
- "Id" : 1179302772906958881,
- "ENName" : "The Bayview Hotel Pattaya"
- },
- {
- "Id" : 1179302772906958896,
- "ENName" : "The Surin Phuket"
- },
- {
- "Id" : 1179302772906958903,
- "ENName" : "Metadee Concept Hotel (SHA Extra Plus)"
- },
- {
- "Id" : 1179302780486066272,
- "ENName" : "Rawi Warin Resort and Spa(SHA Extra Plus)"
- },
- {
- "Id" : 1179302795359068205,
- "ENName" : "SAii Koh Samui Choengmon"
- },
- {
- "Id" : 1179302795359068241,
- "ENName" : "Rarin Jinda Wellness Spa Resort"
- },
- {
- "Id" : 1179302810102046795,
- "ENName" : "Sand Sea Resort Railay Krabi"
- },
- {
- "Id" : 1179302824845025302,
- "ENName" : "VIE Hotel Bangkok, MGallery Hotel Collection"
- },
- {
- "Id" : 1179302832143114241,
- "ENName" : "Park Hyatt Bangkok"
- },
- {
- "Id" : 1179302832143114282,
- "ENName" : "Malisa Villa Suites (SHA Extra Plus)"
- },
- {
- "Id" : 1179302876837617667,
- "ENName" : "Eastin Tan Hotel Chiang Mai"
- },
- {
- "Id" : 1179303117871685699,
- "ENName" : "Sindhorn Midtown Hotel Bangkok, Vignette Collection - an IHG Hotel"
- },
- {
- "Id" : 1179302758386278407,
- "ENName" : "Shangri-La Hotel Bangkok"
- },
- {
- "Id" : 1179302758386278449,
- "ENName" : "Eastin Grand Hotel Sathorn"
- },
- {
- "Id" : 1179302758386278451,
- "ENName" : "Layana Resort & Spa(SHA Extra Plus)"
- },
- {
- "Id" : 1179302758386278452,
- "ENName" : "Banyan Tree Krabi"
- },
- {
- "Id" : 1179302758386278453,
- "ENName" : "Banyan Tree Samui (SHA Plus+)"
- },
- {
- "Id" : 1179302758386278457,
- "ENName" : "SO Bangkok"
- },
- {
- "Id" : 1179302758386278466,
- "ENName" : "The Ritz-Carlton, Koh Samui"
- },
- {
- "Id" : 1179302758386278472,
- "ENName" : "Movenpick Bdms Wellness Resort Bangkok"
- },
- {
- "Id" : 1179302758386278474,
- "ENName" : "Anantara Koh YAO Yai Resort & Villas"
- },
- {
- "Id" : 1179302765696950349,
- "ENName" : "Pimalai Resort & Spa"
- },
- {
- "Id" : 1179302765696950351,
- "ENName" : "Siam Bayshore Resort Pattaya"
- },
- {
- "Id" : 1179302772906958880,
- "ENName" : "Centara Grand Mirage Beach Resort Pattaya"
- },
- {
- "Id" : 1179302787939344464,
- "ENName" : "Mercure Bangkok Makkasan"
- },
- {
- "Id" : 1179302802724266023,
- "ENName" : "Sofitel Krabi Phokeethra Golf and Spa Resort (SHA Plus+)"
- },
- {
- "Id" : 1179302824845025296,
- "ENName" : "Ramada Plaza by Wyndham Bangkok Menam Riverside"
- },
- {
- "Id" : 1179302824845025306,
- "ENName" : "Aonang Villa Resort(SHA Extra Plus)"
- },
- {
- "Id" : 1179302832143114256,
- "ENName" : "Crowne Plaza Phuket Panwa Beach"
- },
- {
- "Id" : 1179302832143114289,
- "ENName" : "Renaissance Pattaya Resort & Spa - Sha Extra Plus"
- },
- {
- "Id" : 1179302839474757712,
- "ENName" : "Hard Rock Hotel Pattaya"
- },
- {
- "Id" : 1179302854100295763,
- "ENName" : "Vignette Collection Dinso Resort & Villas Phuket, an IHG Hotel"
- },
- {
- "Id" : 1179302861423550560,
- "ENName" : "Mercure Bangkok Sukhumvit 11"
- },
- {
- "Id" : 1179302943950676062,
- "ENName" : "Raya Heritage (SHA Extra Plus)"
- },
- {
- "Id" : 1179303102436646978,
- "ENName" : "Levana Pattaya Hotel"
- },
- {
- "Id" : 1179313309405454351,
- "ENName" : "New World Phu Quoc"
- },
- {
- "Id" : 1179313309405454384,
- "ENName" : "Hotel Naru Seoul MGallery Ambassador"
- },
- {
- "Id" : 1179313337494708229,
- "ENName" : "Amber Hotel Central"
- },
- {
- "Id" : 1179313337494708238,
- "ENName" : "HARRIS Hotel Kuta Tuban Bali"
- },
- {
- "Id" : 1179313337494708246,
- "ENName" : "Villa Samadhi by Samadhi"
- },
- {
- "Id" : 1179313352191549453,
- "ENName" : "Migliore Hotel Seoul Myeongdong"
- },
- {
- "Id" : 1179313380272414745,
- "ENName" : "Studio M Hotel"
- },
- {
- "Id" : 1179313380272414761,
- "ENName" : "Best Western Premier Gangnam Hotel"
- },
- {
- "Id" : 1179313380272414764,
- "ENName" : "The Westin Josun Seoul"
- },
- {
- "Id" : 1179313380272414774,
- "ENName" : "Mia Resort Nha Trang"
- },
- {
- "Id" : 1179313409217306647,
- "ENName" : "Shangri-La Rasa Ria, Kota Kinabalu"
- },
- {
- "Id" : 1179313409217306655,
- "ENName" : "Goodwood Park Hotel"
- },
- {
- "Id" : 1179313409217306660,
- "ENName" : "The Oberoi Beach Resort, Bali"
- },
- {
- "Id" : 1179313437403029526,
- "ENName" : "Grand Millennium Kuala Lumpur"
- },
- {
- "Id" : 1179313597164068881,
- "ENName" : "Conrad Bali"
- },
- {
- "Id" : 1179313597164068913,
- "ENName" : "Redtop Hotel & Convention Center"
- },
- {
- "Id" : 1179313626155098160,
- "ENName" : "Padma Resort Ubud Bali"
- },
- {
- "Id" : 1179313841255784498,
- "ENName" : "Hotel Villa Fontaine Grand Tokyo-Shiodome"
- },
- {
- "Id" : 1179313927272570939,
- "ENName" : "Holiday Inn Express Baruna, an IHG Hotel"
- },
- {
- "Id" : 1179313984705175618,
- "ENName" : "The Ambassador Seoul - A Pullman Hotel"
- },
- {
- "Id" : 1179314114292392002,
- "ENName" : "Mercure Kuala Lumpur Shaw Parade"
- },
- {
- "Id" : 1179314202012065797,
- "ENName" : "Amiana Resort Nha Trang"
- },
- {
- "Id" : 1179314230931791878,
- "ENName" : "Carlton City Hotel Singapore"
- },
- {
- "Id" : 1179314230931791879,
- "ENName" : "Carlton Hotel Singapore"
- },
- {
- "Id" : 1179314260233199628,
- "ENName" : "The Seacare Hotel"
- },
- {
- "Id" : 1179314260233199686,
- "ENName" : "One Farrer Hotel"
- },
- {
- "Id" : 1179303132962791494,
- "ENName" : "Seabed Grand Hotel Phuket(SHA Extra Plus)"
- },
- {
- "Id" : 1179303155528147014,
- "ENName" : "Panwaburi Beachfront Resort(SHA Extra Plus)"
- },
- {
- "Id" : 1179303765497389083,
- "ENName" : "Regal Riverside Hotel"
- },
- {
- "Id" : 1179303773407846474,
- "ENName" : "LArc Macau"
- },
- {
- "Id" : 1179303773407846475,
- "ENName" : "Mandarin Oriental Macau"
- },
- {
- "Id" : 1179303781356052540,
- "ENName" : "Hong Kong Disneyland Hotel"
- },
- {
- "Id" : 1179313280867409925,
- "ENName" : "Millennium Mitsui Garden Hotel Tokyo"
- },
- {
- "Id" : 1179313280867409934,
- "ENName" : "Mitsui Garden Hotel Roppongi Tokyo Premier"
- },
- {
- "Id" : 1179313294817665050,
- "ENName" : "Capri by Fraser Bukit Bintang"
- },
- {
- "Id" : 1179313294817665051,
- "ENName" : "Pavilion Hotel Kuala Lumpur Managed by Banyan Tree"
- },
- {
- "Id" : 1179313309405454347,
- "ENName" : "Mulia Resort Nusa Dua Bali"
- },
- {
- "Id" : 1179313309405454375,
- "ENName" : "Six Senses Uluwatu"
- },
- {
- "Id" : 1179313309405454380,
- "ENName" : "Four Points by Sheraton Singapore, Riverview (SG Clean)"
- },
- {
- "Id" : 1179313352191549454,
- "ENName" : "Palazzo Versace Dubai"
- },
- {
- "Id" : 1179313366032752662,
- "ENName" : "Hotel Boss Singapore"
- },
- {
- "Id" : 1179313380272414768,
- "ENName" : "Ming Garden Hotel & Residences Kota Kinabalu"
- },
- {
- "Id" : 1179313395095085056,
- "ENName" : "Four Seasons Resort Langkawi"
- },
- {
- "Id" : 1179313395095085079,
- "ENName" : "Pullman Saigon Centre"
- },
- {
- "Id" : 1179313582085546026,
- "ENName" : "Century Park Hotel"
- },
- {
- "Id" : 1179313611831549970,
- "ENName" : "Merlynn Park Hotel"
- },
- {
- "Id" : 1179313611831550008,
- "ENName" : "The Grove Suites by GRAND ASTON"
- },
- {
- "Id" : 1179313611831550026,
- "ENName" : "Hilton Garden Inn Bali Ngurah Rai Airport"
- },
- {
- "Id" : 1179313827125174275,
- "ENName" : "Hotel Leo"
- },
- {
- "Id" : 1179313827125174283,
- "ENName" : "The Shilla Jeju"
- },
- {
- "Id" : 1179313984705175637,
- "ENName" : "Vista Walkerhill Seoul - formerly W Seoul"
- },
- {
- "Id" : 1179302758386278410,
- "ENName" : "Four Seasons Hotel Bangkok at Chao Phraya River"
- },
- {
- "Id" : 1179302758386278445,
- "ENName" : "Conrad Koh Samui"
- },
- {
- "Id" : 1179302765696950278,
- "ENName" : "Nora Buri Resort & Spa"
- },
- {
- "Id" : 1179302765696950288,
- "ENName" : "Holiday Inn Express Bangkok Sathorn, an IHG Hotel"
- },
- {
- "Id" : 1179302765696950327,
- "ENName" : "Four Seasons Resort Koh Samui"
- },
- {
- "Id" : 1179302765696950336,
- "ENName" : "Six Senses Koh Samui"
- },
- {
- "Id" : 1179302772906958911,
- "ENName" : "Akyra Manor Chiang Mai"
- },
- {
- "Id" : 1179302772906958945,
- "ENName" : "Kata Rocks Hotel Phuket"
- },
- {
- "Id" : 1179302780486066228,
- "ENName" : "Aster Hotel and Residence"
- },
- {
- "Id" : 1179302787939344450,
- "ENName" : "Avista Hideaway Phuket Patong - MGallery (SHA Extra Plus)"
- },
- {
- "Id" : 1179302795359068192,
- "ENName" : "Holiday Inn Bangkok Silom, an IHG Hotel"
- },
- {
- "Id" : 1179302795359068236,
- "ENName" : "Ibis Styles Phuket City"
- },
- {
- "Id" : 1179302795359068246,
- "ENName" : "Amora Thapae Hotel Chiang Mai"
- },
- {
- "Id" : 1179302802724266018,
- "ENName" : "LANTA CHA-DA BEACH RESORT & SPA(SHA Extra Plus)"
- },
- {
- "Id" : 1179302802724266020,
- "ENName" : "Dusit Thani Krabi Beach Resort"
- },
- {
- "Id" : 1179302839474757680,
- "ENName" : "Crowne Plaza Bangkok Lumpini Park, an IHG Hotel"
- },
- {
- "Id" : 1179303048925716516,
- "ENName" : "Lub D Koh Samui Chaweng Beach"
- },
- {
- "Id" : 1179303079888068619,
- "ENName" : "Novotel Chiangmai Nimman Journeyhub"
- },
- {
- "Id" : 1179303163316969487,
- "ENName" : "Thai Fight Hotel"
- },
- {
- "Id" : 1179303186016542734,
- "ENName" : "Chanalai Hillside Resort"
- },
- {
- "Id" : 1179303781356052492,
- "ENName" : "Metropark Hotel Macau"
- },
- {
- "Id" : 1179303789417504782,
- "ENName" : "Harbour Grand Kowloon"
- },
- {
- "Id" : 1179313309405454336,
- "ENName" : "Hotel Hankyu RESPIRE OSAKA"
- },
- {
- "Id" : 1179313309405454381,
- "ENName" : "Centara Grand Hotel Osaka"
- },
- {
- "Id" : 1179314274934235197,
- "ENName" : "Oasia Hotel Downtown, Singapore by Far East Hospitality (Staycation Approved)"
- },
- {
- "Id" : 1179314319020564537,
- "ENName" : "Lone Pine Hotel Penang (PenangFightCovid-19 Certified)"
- },
- {
- "Id" : 1179314376868405262,
- "ENName" : "Berjaya Times Square Kuala Lumpur"
- },
- {
- "Id" : 1179314376868405287,
- "ENName" : "Swissotel the Stamford"
- },
- {
- "Id" : 1179314420069736455,
- "ENName" : "Ocean Suites Jeju Hotel"
- },
- {
- "Id" : 1179314420069736488,
- "ENName" : "Monarque Hotel Danang"
- },
- {
- "Id" : 1179314477951131658,
- "ENName" : "Hoshino Resorts Risonare Tomamu Hotel Hokkaido"
- },
- {
- "Id" : 1179314506912800811,
- "ENName" : "The Majestic Hotel Kuala Lumpur, Autograph Collection"
- },
- {
- "Id" : 1179314594091409476,
- "ENName" : "Anantara Desert Islands Resort & Spa"
- },
- {
- "Id" : 1179314594091409490,
- "ENName" : "Conrad Abu Dhabi Etihad Towers"
- },
- {
- "Id" : 1179314944890413062,
- "ENName" : "OMO5 Tokyo Otsuka by Hoshino Resorts"
- },
- {
- "Id" : 1179315255176634390,
- "ENName" : "Travelodge Myeongdong City Hall"
- },
- {
- "Id" : 1179315255176634406,
- "ENName" : "Plataran Ubud Hotel & Spa - CHSE Certified"
- },
- {
- "Id" : 1179315342430740515,
- "ENName" : "Fourpoints by Sheraton Seoul Gangnam"
- },
- {
- "Id" : 1179316545805918229,
- "ENName" : "Jhl Solitaire Gading Serpong"
- },
- {
- "Id" : 1179316667759501313,
- "ENName" : "Cross Bali Breakers"
- },
- {
- "Id" : 1179316895132721188,
- "ENName" : "Liber Hotel at Universal Studio Japan"
- },
- {
- "Id" : 1179317060816117811,
- "ENName" : "Kaamala Resort Ubud"
- },
- {
- "Id" : 1179317283491717194,
- "ENName" : "Aston Kemayoran City Hotel"
- },
- {
- "Id" : 1179317355784740895,
- "ENName" : "Dears Myeongdong"
- },
- {
- "Id" : 1179317385891455044,
- "ENName" : "MAUA Nusa Penida Bali"
- },
- {
- "Id" : 1179317431198326794,
- "ENName" : "Ana Mandara Cam Ranh"
- },
- {
- "Id" : 1179318020930052100,
- "ENName" : "Sleeping Lion Suites"
- },
- {
- "Id" : 1179303117871685648,
- "ENName" : "Carlton Hotel Bangkok Sukhumvit (SHA Plus+)"
- },
- {
- "Id" : 1179303163316969512,
- "ENName" : "Renaissance Koh Samui Resort & Spa"
- },
- {
- "Id" : 1179303186016542720,
- "ENName" : "Lanna Samui"
- },
- {
- "Id" : 1179303239053516828,
- "ENName" : "Phuket Emerald Beach Resort"
- },
- {
- "Id" : 1179303765497389131,
- "ENName" : "The Royal Pacific Hotel and Towers"
- },
- {
- "Id" : 1179303765497389134,
- "ENName" : "The Kowloon Hotel"
- },
- {
- "Id" : 1179303773407846412,
- "ENName" : "Hotel Lisboa"
- },
- {
- "Id" : 1179303773407846466,
- "ENName" : "Hotel Sintra"
- },
- {
- "Id" : 1179303781356052537,
- "ENName" : "Disneys Hollywood Hotel"
- },
- {
- "Id" : 1179305732848263220,
- "ENName" : "Harbour Grand Hong Kong"
- },
- {
- "Id" : 1179305742071537721,
- "ENName" : "Hongkong Disney Explorers Lodge"
- },
- {
- "Id" : 1179313280867409938,
- "ENName" : "Cerulean Tower Tokyu Hotel Tokyo"
- },
- {
- "Id" : 1179313294817665065,
- "ENName" : "Hotel Vischio Osaka"
- },
- {
- "Id" : 1179313309405454373,
- "ENName" : "Bulgari Resort Bali"
- },
- {
- "Id" : 1179313352191549463,
- "ENName" : "Swiss-Belinn Legian"
- },
- {
- "Id" : 1179313366032752657,
- "ENName" : "The Bellevue Resort"
- },
- {
- "Id" : 1179313395095085105,
- "ENName" : "Movenpick Resort & Spa Jimbaran Bali"
- },
- {
- "Id" : 1179313395095085109,
- "ENName" : "Mithi Resort and Spa Bohol"
- },
- {
- "Id" : 1179313409217306630,
- "ENName" : "Pullman Kuala Lumpur City Centre Hotel & Residences"
- },
- {
- "Id" : 1179313423066898445,
- "ENName" : "Coast Boracay"
- },
- {
- "Id" : 1179313582081351694,
- "ENName" : "Berry Amour Romantic Villas"
- },
- {
- "Id" : 1179313597164068947,
- "ENName" : "Swiss-Belresort Watu Jimbar"
- },
- {
- "Id" : 1179313611831550018,
- "ENName" : "Holiday Inn Resort Baruna Bali, an IHG Hotel"
- },
- {
- "Id" : 1179313798469689375,
- "ENName" : "Sheraton Miyako Hotel Osaka"
- },
- {
- "Id" : 1179313798469689407,
- "ENName" : "Sotetsu Grand Fresa Tokyo-Bay Ariake"
- },
- {
- "Id" : 1179313813116198923,
- "ENName" : "Shibuya Excel Hotel Tokyu Tokyo"
- },
- {
- "Id" : 1179318020930052186,
- "ENName" : "Oasia Hotel Novena, Singapore by Far East Hospitality"
- },
- {
- "Id" : 1179661167287640064,
- "ENName" : "Silavadee Pool Spa Resort"
- },
- {
- "Id" : 1179662920645124096,
- "ENName" : "Borneo Divers Mabul Resort Semporna"
- },
- {
- "Id" : 1179663349131026432,
- "ENName" : "Sipadan Kapalai Dive Resort"
- },
- {
- "Id" : 1179728128717660160,
- "ENName" : "Alma Resort Cam Ranh"
- },
- {
- "Id" : 1179728218823892992,
- "ENName" : "Radisson Blu Resort Cam Ranh"
- },
- {
- "Id" : 1184342385539194880,
- "ENName" : "Kimpton Kitalay Samui, an IHG Hotel"
- },
- {
- "Id" : 1188688637324206080,
- "ENName" : "The Racha (SHA Plus+)"
- },
- {
- "Id" : 1194847744590651392,
- "ENName" : "Four Seasons Hotel Seoul"
- },
- {
- "Id" : 1179313337494708228,
- "ENName" : "Maison Glad Jeju"
- },
- {
- "Id" : 1179313337494708234,
- "ENName" : "InterContinental Nha Trang, an Ihg Hotel"
- },
- {
- "Id" : 1179313380272414744,
- "ENName" : "M Social Singapore"
- },
- {
- "Id" : 1179313380272414757,
- "ENName" : "InterContinental Seoul COEX"
- },
- {
- "Id" : 1179313395095085092,
- "ENName" : "Anantara Hoi An Resort"
- },
- {
- "Id" : 1179313409217306656,
- "ENName" : "Shilla Stay Jeju"
- },
- {
- "Id" : 1179313597164068884,
- "ENName" : "Hotel Indonesia Kempinski Jakarta"
- },
- {
- "Id" : 1179313597164068898,
- "ENName" : "Favehotel Tanah Abang - Cideng"
- },
- {
- "Id" : 1179313813116198913,
- "ENName" : "Palace Hotel Tokyo"
- },
- {
- "Id" : 1179313813116198916,
- "ENName" : "The Peninsula Tokyo"
- },
- {
- "Id" : 1179313927272570923,
- "ENName" : "Swiss-Belhotel Tuban"
- },
- {
- "Id" : 1179313956179714090,
- "ENName" : "Ramada Encore by Wyndham Bali Seminyak"
- },
- {
- "Id" : 1179313984705175610,
- "ENName" : "Hotel Samjung Seoul"
- },
- {
- "Id" : 1179313984705175612,
- "ENName" : "Grand Walkerhill Seoul"
- },
- {
- "Id" : 1179314013218054202,
- "ENName" : "Conrad Osaka"
- },
- {
- "Id" : 1179314084970012704,
- "ENName" : "Be Grand Resort Bohol"
- },
- {
- "Id" : 1179314084970012715,
- "ENName" : "Iconic Hotel Penang"
- },
- {
- "Id" : 1179314143618965538,
- "ENName" : "Berjaya Langkawi Resort"
- },
- {
- "Id" : 1179314143618965573,
- "ENName" : "Hotel Shangri-la Kota Kinabalu"
- },
- {
- "Id" : 1179314158320001027,
- "ENName" : "The Palace Hotel Kota Kinabalu"
- },
- {
- "Id" : 1179314173016842333,
- "ENName" : "Avangio Hotel Kota Kinabalu"
- },
- {
- "Id" : 1179314230927597589,
- "ENName" : "Holiday Inn Express Kuala Lumpur City Centre"
- },
- {
- "Id" : 1179314230931791877,
- "ENName" : "Royal Plaza on Scotts Singapore"
- },
- {
- "Id" : 1179314230931791881,
- "ENName" : "Fairmont Singapore"
- },
- {
- "Id" : 1179314245595078657,
- "ENName" : "Sofitel Singapore Sentosa Resort & Spa (Staycation Approved)"
- },
- {
- "Id" : 1179314260233199663,
- "ENName" : "Grand Copthorne Waterfront"
- },
- {
- "Id" : 1179314143618965534,
- "ENName" : "Bayview Hotel Langkawi"
- },
- {
- "Id" : 1179314216599855157,
- "ENName" : "Liberty Central Saigon Centre Hotel"
- },
- {
- "Id" : 1179314230931791882,
- "ENName" : "YWCA Fort Canning"
- },
- {
- "Id" : 1179314230931791884,
- "ENName" : "Peninsula Excelsior Hotel Singapore"
- },
- {
- "Id" : 1179314260233199670,
- "ENName" : "Crowne Plaza Changi Airport Singapore"
- },
- {
- "Id" : 1179314260233199675,
- "ENName" : "Dorsett Singapore"
- },
- {
- "Id" : 1179314319020564564,
- "ENName" : "AYANA Resort Bali"
- },
- {
- "Id" : 1179314376868405271,
- "ENName" : "Dayang Bay Resort Langkawi"
- },
- {
- "Id" : 1179314434301009934,
- "ENName" : "Gloucester Hotel Jeju"
- },
- {
- "Id" : 1179314463669526557,
- "ENName" : "Kaze No Terrace Kukuna Hotel"
- },
- {
- "Id" : 1179314477951131664,
- "ENName" : "Radisson Blu Bali Uluwatu"
- },
- {
- "Id" : 1179314477951131669,
- "ENName" : "Siloso Beach Resort, Sentosa"
- },
- {
- "Id" : 1179314536205819960,
- "ENName" : "Aston Canggu Beach Resort"
- },
- {
- "Id" : 1179314579830775816,
- "ENName" : "Hotel Mi Singapore"
- },
- {
- "Id" : 1179314594091409462,
- "ENName" : "Jannah Burj Al Sarab"
- },
- {
- "Id" : 1179314828343287822,
- "ENName" : "Anantara the Palm Dubai Resort"
- },
- {
- "Id" : 1179314944890413093,
- "ENName" : "Co-op City Hotel Seongsan"
- },
- {
- "Id" : 1179315561402769427,
- "ENName" : "Hotel Monterey Lefrere Osaka"
- },
- {
- "Id" : 1179316054241878055,
- "ENName" : "Ibis Styles Kota Kinabalu Inanam Hotel"
- },
- {
- "Id" : 1179316316713033783,
- "ENName" : "Wyndham Casablanca Jakarta"
- },
- {
- "Id" : 1179316895132721213,
- "ENName" : "Aksari Resort Ubud by Ini Vie Hospitality - CHSE Certified"
- },
- {
- "Id" : 1179316910181883945,
- "ENName" : "The Clan Hotel Singapore by Far East Hospitality"
- },
- {
- "Id" : 1179317199190401081,
- "ENName" : "OZO George Town Penang"
- },
- {
- "Id" : 1179317370733240389,
- "ENName" : "Oriental Hotel Universal City"
- },
- {
- "Id" : 1179317416123998209,
- "ENName" : "Paramount Hotel Midtown"
- },
- {
- "Id" : 1179317522629959754,
- "ENName" : "Aloft Langkawi Pantai Tengah"
- },
- {
- "Id" : 1179317597691224064,
- "ENName" : "SKY Water Villas"
- },
- {
- "Id" : 1179317703354130492,
- "ENName" : "Owen House by Hmlet"
- },
- {
- "Id" : 1179317960041341000,
- "ENName" : "POM POM Island Resort"
- },
- {
- "Id" : 1179318005763448868,
- "ENName" : "INNSiDE by Melia Kuala Lumpur Cheras"
- },
- {
- "Id" : 1179318005763448913,
- "ENName" : "New World Hoiana Beach Resort"
- },
- {
- "Id" : 1179318020930052102,
- "ENName" : "Bohol Dolphin Bay Resort"
- },
- {
- "Id" : 1179318020930052106,
- "ENName" : "Hotel Groove Shinjuku, A Parkroyal Hotel"
- },
- {
- "Id" : 1179318157995712540,
- "ENName" : "Four Points by Sheraton Bali, Kuta"
- },
- {
- "Id" : 1179319720059379761,
- "ENName" : "The Face Style"
- },
- {
- "Id" : 1179658140988252160,
- "ENName" : "Cape Dara Resort"
- },
- {
- "Id" : 1179715670460375040,
- "ENName" : "Japamala Resorts - by Samadhi - Adults Only"
- },
- {
- "Id" : 1179721964105801728,
- "ENName" : "Sutera @ Mantanani Island Resort & Spa"
- },
- {
- "Id" : 1179722225750679552,
- "ENName" : "Best Western Premier Sonasea Villas Phu Quoc"
- },
- {
- "Id" : 1179723501980917760,
- "ENName" : "Mandarin Nest Boracay"
- },
- {
- "Id" : 1179727868628869120,
- "ENName" : "Meruorah Komodo Labuan Bajo"
- },
- {
- "Id" : 1179731190874152960,
- "ENName" : "Avante Hotel"
- },
- {
- "Id" : 1179732206034132992,
- "ENName" : "Feliz Hotel Boracay"
- },
- {
- "Id" : 1179733283622133760,
- "ENName" : "Hoshino Resorts Tomamu the Tower"
- },
- {
- "Id" : 1181773188003045376,
- "ENName" : "Hotel Yukari no Mori Kawaguchiko"
- },
- {
- "Id" : 1181781266450653184,
- "ENName" : "ClubMed Tomamu Resort Hokkaido"
- },
- {
- "Id" : 1185116168927617024,
- "ENName" : "Pullman Phuket Karon Beach Resort"
- },
- {
- "Id" : 1186487394266816512,
- "ENName" : "Mountain Resort Koh Lipe"
- },
- {
- "Id" : 1186487610327998464,
- "ENName" : "Anda Lipe Resort"
- },
- {
- "Id" : 1190229712954236928,
- "ENName" : "Melia Vinpearl Phu Quoc"
- },
- {
- "Id" : 1179313869772857358,
- "ENName" : "Hotel Gracery Shinjuku Tokyo"
- },
- {
- "Id" : 1179314041760292925,
- "ENName" : "The Tower Plaza Hotel Dubai"
- },
- {
- "Id" : 1179314216599855166,
- "ENName" : "Liberty Central Saigon Citypoint"
- },
- {
- "Id" : 1179314230927597613,
- "ENName" : "Liberty Central Saigon Riverside Hotel"
- },
- {
- "Id" : 1179314245595078715,
- "ENName" : "JW Marriott Hotel Kuala Lumpur"
- },
- {
- "Id" : 1179314260233199666,
- "ENName" : "PARKROYAL COLLECTION Marina Bay, Singapore"
- },
- {
- "Id" : 1179314274934235146,
- "ENName" : "Swiss-Garden Hotel Bukit Bintang Kuala Lumpur"
- },
- {
- "Id" : 1179314319020564563,
- "ENName" : "RIMBA by AYANA Bali"
- },
- {
- "Id" : 1179314347885764609,
- "ENName" : "The Westin Osaka"
- },
- {
- "Id" : 1179314362251255878,
- "ENName" : "Dusit Thani Abu Dhabi"
- },
- {
- "Id" : 1179314391208730625,
- "ENName" : "Bohol Beach Club"
- },
- {
- "Id" : 1179314434301009931,
- "ENName" : "Aloft Seoul Gangnam"
- },
- {
- "Id" : 1179314434301010008,
- "ENName" : "Wyndham Danang Golden Bay"
- },
- {
- "Id" : 1179314477951131692,
- "ENName" : "Jeju Shinhwa World Marriott Resort"
- },
- {
- "Id" : 1179314594091409505,
- "ENName" : "Shangri-la Hotel, Qayrayt Al Beri, Abu Dhabi"
- },
- {
- "Id" : 1179314608435929090,
- "ENName" : "Traders Hotel, Qaryat Al Beri"
- },
- {
- "Id" : 1179314740539727953,
- "ENName" : "The Capitol Kempinski Hotel Singapore"
- },
- {
- "Id" : 1179315255176634396,
- "ENName" : "Hotel Sirius"
- },
- {
- "Id" : 1179315445669339172,
- "ENName" : "Premier Village Phu Quoc Resort Managed by AccorHotels"
- },
- {
- "Id" : 1179315489227186224,
- "ENName" : "Ibis Kuala Lumpur City Centre"
- },
- {
- "Id" : 1179316211553443862,
- "ENName" : "The Apurva Kempinski Bali"
- },
- {
- "Id" : 1179316363278196749,
- "ENName" : "citizenM Kuala Lumpur Bukit Bintang"
- },
- {
- "Id" : 1179316864069705778,
- "ENName" : "Fuji Kawaguchiko Resort Hotel"
- },
- {
- "Id" : 1179316910181883960,
- "ENName" : "W Osaka"
- },
- {
- "Id" : 1179316940015968256,
- "ENName" : "Zentis Osaka"
- },
- {
- "Id" : 1179316955497144341,
- "ENName" : "Hotel Villa Fontaine Grand Tokyo Ariake"
- },
- {
- "Id" : 1179317385891455011,
- "ENName" : "Hotel Traveltine"
- },
- {
- "Id" : 1179317416123998240,
- "ENName" : "Tribe Bali Kuta Beach"
- },
- {
- "Id" : 1179318005763448839,
- "ENName" : "Singamata Adventures and Reef Resort Semporna"
- },
- {
- "Id" : 1179318020930052097,
- "ENName" : "Pullman Singapore Orchard"
- },
- {
- "Id" : 1179711890746548224,
- "ENName" : "Pullman Singapore Hill Street (Opening October 2023)"
- },
- {
- "Id" : 1179714423997112320,
- "ENName" : "Gayana Marine Resort"
- },
- {
- "Id" : 1179715112752160768,
- "ENName" : "Dreamtel Kota Kinabalu"
- },
- {
- "Id" : 1179716658604843008,
- "ENName" : "Mabul Water Bungalows"
- },
- {
- "Id" : 1179723312603897856,
- "ENName" : "Mandarin Bay Resort and Spa"
- },
- {
- "Id" : 1179727956122050560,
- "ENName" : "Bunga Raya Island Resort & Spa"
- },
- {
- "Id" : 1179731661642833920,
- "ENName" : "The Danna Langkawi Hotel"
- },
- {
- "Id" : 1179732414017085440,
- "ENName" : "Semabu Hills Hotel Nusa Penida"
- },
- {
- "Id" : 1185080571353669636,
- "ENName" : "InterContinental Bali Sanur Resort, an IHG Hotel"
- },
- {
- "Id" : 1186910472885018624,
- "ENName" : "Le Méridien Phuket Mai Khao Beach Resort"
- },
- {
- "Id" : 1179314274934235212,
- "ENName" : "Hotel Sixty3 Kota Kinabalu"
- },
- {
- "Id" : 1179314347885764620,
- "ENName" : "Hotel Ciputra Jakarta managed by Swiss-Belhotel International"
- },
- {
- "Id" : 1179314347885764644,
- "ENName" : "Hotel Indigo Bali Seminyak Beach, an IHG Hotel"
- },
- {
- "Id" : 1179314376868405267,
- "ENName" : "The Face Suites"
- },
- {
- "Id" : 1179314376868405292,
- "ENName" : "Orchard Hotel Singapore"
- },
- {
- "Id" : 1179314463669526558,
- "ENName" : "Shuhokaku Kogetsu"
- },
- {
- "Id" : 1179314477951131690,
- "ENName" : "Somerset Jeju Shinhwa World"
- },
- {
- "Id" : 1179314594091409500,
- "ENName" : "Anantara Qasr al Sarab Desert Resort"
- },
- {
- "Id" : 1179314871771111450,
- "ENName" : "Glad Hotel Mapo"
- },
- {
- "Id" : 1179314871771111483,
- "ENName" : "Baiton Seoul Dongdaemun"
- },
- {
- "Id" : 1179315284482236442,
- "ENName" : "Pan Borneo Hotel Kota Kinabalu"
- },
- {
- "Id" : 1179315298839339031,
- "ENName" : "Ibis Ambassador Myeongdong"
- },
- {
- "Id" : 1179315387339153484,
- "ENName" : "Yarra Ocean Suites Danang"
- },
- {
- "Id" : 1179316697979461681,
- "ENName" : "Best Western Premier Sonasea Phu Quoc"
- },
- {
- "Id" : 1179316818813165639,
- "ENName" : "The Story Resort"
- },
- {
- "Id" : 1179316848999571511,
- "ENName" : "Potato Head Suites and Studios"
- },
- {
- "Id" : 1179316864069705790,
- "ENName" : "Andaz Seoul Gangnam"
- },
- {
- "Id" : 1179316879592824899,
- "ENName" : "Shinhwa Jeju Shinhwa World Hotels & Resorts"
- },
- {
- "Id" : 1179316895132721152,
- "ENName" : "Landabout Tokyo"
- },
- {
- "Id" : 1179316940015968288,
- "ENName" : "Paramount Hotel Dubai"
- },
- {
- "Id" : 1179316955497144376,
- "ENName" : "Tokyu Stay Shinjuku Eastside"
- },
- {
- "Id" : 1179317121193123885,
- "ENName" : "Lintas Platinum Hotel"
- },
- {
- "Id" : 1179317431198326787,
- "ENName" : "Hyatt Centric Kota Kinabalu"
- },
- {
- "Id" : 1179317431198326789,
- "ENName" : "Monocolo Boutique Hotel"
- },
- {
- "Id" : 1179318005763448840,
- "ENName" : "SEA STAR RESORT SEMPORNA"
- },
- {
- "Id" : 1179318005763448915,
- "ENName" : "Omo Kansai Airport by Hoshino Resorts"
- },
- {
- "Id" : 1179360515076431872,
- "ENName" : "A-One the Royal Cruise Hotel Pattaya (SHA Extra Plus)"
- },
- {
- "Id" : 1179626276017709056,
- "ENName" : "Amari Pattaya (SHA Plus+)"
- },
- {
- "Id" : 1179681342879735808,
- "ENName" : "Plataran Komodo Resort & Spa - CHSE Certified"
- },
- {
- "Id" : 1179712878580637696,
- "ENName" : "Citadines Connect City Centre Singapore"
- },
- {
- "Id" : 1179727658133528576,
- "ENName" : "Sylvia Hotel & Resort Komodo"
- },
- {
- "Id" : 1179728746119208960,
- "ENName" : "The Majestic Malacca Hotel"
- },
- {
- "Id" : 1179732014262165504,
- "ENName" : "Loboc River Resort"
- },
- {
- "Id" : 1179732623849725952,
- "ENName" : "Royale Chulan Seremban"
- },
- {
- "Id" : 1179738039090454528,
- "ENName" : "New World Hoiana Hotel Vietnam"
- },
- {
- "Id" : 1181845224335384576,
- "ENName" : "The Ritz-Carlton Bali"
- },
- {
- "Id" : 1184441436720898048,
- "ENName" : "Sri Panwa Phuket Luxury Pool Villa Hotel (SHA Plus+)"
- }
- ]
- country_dict = {
- "东京": ["日本", "Japan", "Tokyo"],
- "仙本那": ["马来西亚", "Malaysia", "Semporna"],
- "会安": ["越南", "Vietnam", "Hoi An"],
- "兰卡威": ["马来西亚", "Malaysia", "Langkawi"],
- "北海道": ["日本", "Japan", "Hokkaido"],
- "吉隆坡": ["马来西亚", "Malaysia", "Kuala Lumpur"],
- "大阪": ["日本", "Japan", "Osaka"],
- "富国岛": ["越南", "Vietnam", "Phu Quoc Island"],
- "富士河口湖": ["日本", "Japan", "Mount Fuji"],
- "岘港": ["越南", "Vietnam", "Da Nang"],
- "巴厘岛": ["印度尼西亚", "Indonesia", "Bali"],
- "攀牙": ["泰国", "Thailand", "Phang Nga"],
- "新加坡": ["新加坡", "Singapore", "Singapore"],
- "普吉岛": ["泰国", "Thailand", "Phuket"],
- "曼谷": ["泰国", "Thailand", "Bangkok"],
- "槟城": ["马来西亚", "Malaysia", "Penang"],
- "沙巴": ["马来西亚", "Malaysia", "Sabah"],
- "济州岛": ["韩国", "Korea", "Jeju Island"],
- "清迈": ["泰国", "Thailand", "Chiang Mai"],
- "澳门": ["中国", "China", "Macau"],
- "甲米": ["泰国", "Thailand", "Krabi"],
- "科莫多": ["印度尼西亚", "Indonesia", "Komodo"],
- "素叻": ["泰国", "Thailand", "Surat Thani"],
- "胡志明市": ["越南", "Vietnam", "Ho Chi Minh City"],
- "芭堤雅": ["泰国", "Thailand", "Pattaya"],
- "芽庄": ["越南", "Vietnam", "Nha Trang"],
- "苏梅岛": ["泰国", "Thailand", "Koh Samui"],
- "薄荷岛": ["菲律宾", "Philippines", "Boracay"],
- "迪拜": ["阿联酋", "UAE", "Dubai"],
- "长滩岛": ["菲律宾", "Philippines", "Boracay Island"],
- "阿布扎比": ["阿联酋", "UAE", "Abu Dhabi"],
- "雅加达": ["印度尼西亚", "Indonesia", "Jakarta"],
- "首尔": ["韩国", "Korea", "Seoul"],
- "香港": ["中国", "China", "Hong Kong"],
- "马六甲市": ["马来西亚", "Malaysia", "Malacca City"]
- }
- with open('./json/old_product_list.json', 'r') as f:
- out_type = 3 # 1 输出酒店id 2 输出中文处理结果 3 输出英文处理结果
- hotel_dict = dict([(p['Id'], p['ENName']) for p in hotel_arr])
- in_dict = json.load(f)
- tmp_arr = []
- id_arr = []
- for item in in_dict['contents']:
- id = int(item['value'])
- city = item['cities'][0]
- if out_type == 1:
- id_arr.append(id)
- elif out_type == 2:
- new_item = {
- 'country': country_dict[city][0],
- 'city': '富士山' if city == '富士河口湖' else city,
- 'name': item['name'],
- 'value': id
- }
- if 'picture' in item:
- new_item['path'] = item['picture']
- tmp_arr.append(new_item)
- else:
- new_item = {
- 'country': country_dict[city][1],
- 'city': country_dict[city][2],
- 'name': hotel_dict[id],
- 'value': id
- }
- if 'picture' in item:
- new_item['path'] = item['picture']
- tmp_arr.append(new_item)
-
- if out_type == 1:
- print(id_arr)
- else:
- tmp_arr = sorted(tmp_arr, key=lambda p: (p['country'], p['city']))
- tmp_group = groupby(tmp_arr, key=lambda p: (p['country'], p['city']))
- country_iter = ''
- out_arr = []
- for key, group in tmp_group:
- lst = [({'name': p['name'], 'value': p['value'], 'path': p['path']} if 'path' in p else {'name': p['name'], 'value': p['value']}) for p in group]
- if key[0] != country_iter:
- country_iter = key[0]
- out_arr.append({
- 'countryName': country_iter,
- 'cities': [
- {
- 'cityName': key[1],
- 'productItems': lst
- }
- ]
- })
- else:
- out_arr[-1]['cities'].append({
- 'cityName': key[1],
- 'productItems': lst
- })
- print(json.dumps(out_arr, ensure_ascii=False))
|