From 128150722c904e5dde6d1dfbaf1b57aa0556458f Mon Sep 17 00:00:00 2001 From: Mehmet Aksoy Date: Fri, 28 Jun 2024 12:55:32 +0200 Subject: [PATCH] UI fixes, regex alg. fix, webdriver bug removed. UI fixes.. --- README.md | 117 ++++++++++++++++++ src/Control.py | 12 +- src/DriverSetting.py | 6 +- src/__pycache__/Control.cpython-311.pyc | Bin 0 -> 5903 bytes src/__pycache__/DriverGet.cpython-311.pyc | Bin 0 -> 1892 bytes src/__pycache__/DriverSetting.cpython-311.pyc | Bin 0 -> 1395 bytes src/__pycache__/Rota.cpython-311.pyc | Bin 0 -> 5080 bytes src/__pycache__/Sehirler.cpython-311.pyc | Bin 0 -> 4275 bytes src/__pycache__/error_codes.cpython-311.pyc | Bin 0 -> 501 bytes src/__pycache__/ui.cpython-311.pyc | Bin 0 -> 10909 bytes src/requirements.txt | 2 +- src/ui.py | 54 +++++--- 12 files changed, 166 insertions(+), 25 deletions(-) create mode 100644 README.md create mode 100644 src/__pycache__/Control.cpython-311.pyc create mode 100644 src/__pycache__/DriverGet.cpython-311.pyc create mode 100644 src/__pycache__/DriverSetting.cpython-311.pyc create mode 100644 src/__pycache__/Rota.cpython-311.pyc create mode 100644 src/__pycache__/Sehirler.cpython-311.pyc create mode 100644 src/__pycache__/error_codes.cpython-311.pyc create mode 100644 src/__pycache__/ui.cpython-311.pyc diff --git a/README.md b/README.md new file mode 100644 index 0000000..f5ee31d --- /dev/null +++ b/README.md @@ -0,0 +1,117 @@ +TCDD bilet yer kontrol programi sayesinde tcdd sitesine surekli girmek zorunda kalmadan, ayarlayacaginiz periyotlarla websitesinden bilet yer durumunu ogrenebilmeniz saglanmistir. + +mcagriaksoy - tcdd-bilet-yer-kontrol +GitHub tag +License +issues - tcdd-bilet-yer-kontrol +[![OS - Linux](https://img.shields.io/badge/OS-Linux-blue?logo=linux&logoColor=white)](https://www.linux.org/ "Go to Linux homepage") +[![Hosted with GH Pages](https://img.shields.io/badge/Hosted_with-GitHub_Pages-blue?logo=github&logoColor=white)](https://pages.github.com/ "Go to GitHub Pages homepage") +[![OS - Windows](https://img.shields.io/badge/OS-Windows-blue?logo=windows&logoColor=white)](https://www.microsoft.com/ "Go to Microsoft homepage") + +stars - tcdd-bilet-yer-kontrol +forks - tcdd-bilet-yer-kontrol + +## Indir + +[![Download - v2.2.1](https://img.shields.io/static/v1?label=Download&message=v2.2.1&color=2ea44f)](https://github.com/mcagriaksoy/tcdd-bilet-yer-kontrol/releases/download/v2.2.1/TCDD.Bilet.Bulma.Botu.v2.2.1.zip) + +## Versionlar +v2.2.1 +Chrome kaldirildi. Artik Edge ile tarama yapiliyor. +Seleniumdan kaynaklanan bir hata sebebiyle .exe surumu bozuldu. Gecici sureyle GUI arkasinda konsol cikacak. + +v2.2 +- [25.03.2024] Hata cikaran telegram modulu suan icin kaldirildi. +- Daha kucuk executable icin pygame kutuphanesi kucultuldu. +- Icon kaldirildi, iconu avast virus olarak tanimliyordu. :D + +v2.1 +- Eksik olan Eskisehir ili eklendi! + +v2.0 + +- Bilet bulunca ortaya cikan bir hata giderildi. +- Bilet arama algoritmasi optimize edildi. +- Koltuk sayisi hesaplama algoritmasi bastan tasarlandi. +- Ses kutuphanesi duzenlendi. Artik her denemede bir uyari sesi cikiyor. +- Bilet bulununca ortaya cikan ses calamama sorunu cozuldu. +- Eksik olan tum sehirler eklendi. 100+ durak eklendi. + +v1.7 + +- Windows destegi genisletildi! +- Calistirilabilir icerik (.exe) Eklendi! +- Telegram mesaj botu destegi eklendi. Artik bilet bulundugunda telegram uzerinden telefonuna mesaj gonderilebilecek! +- Sesli uyari butonu eklendi. +- Kod optimizasyonu yapildi. Uygulama artik daha hizli calisiyor! + +v1.6 + +- Linux, macOS destegi eklendi. +- PyLint sorunlari cozuldu. +- Dizinleme yapildi. + +v1.5 + +- Yorucu bir release +- Tüm tcdd arayüzü değiştiği için selenium tekrar configure edildi. +- tcdd sitesi bloklamasına karşı, gizli chrome araması kapatıldı, artık chrome program ile birlikte açılıyor. +- selenium hata ayarları güncellendi. +- return mekanizması eklendi, hata kodları ve butonlar güncellendi. +- durak isimleri güncellendi. +- birden fazla aramanın önüne geçebilmek için buton kilitleme işlevi eklendi. + +v1.4 + +- sesli uyarı eklendi. + +v1.3 + +- icon eklendi +- .exe düzeltildi. +- selenium performansı arttırıldı. +- loglama mekanizması düzeltildi. +- bilinen çökme sorunları çözüldü. +- yeni rotalar eklendi. + +SS: +![python_k81455g7zP](https://github.com/mcagriaksoy/tcdd-bilet-yer-kontrol/blob/master/img/screenshot.png) + +v1.1 + +- Slider eklendi. +- Bilet bulunca ortaya çıkan popup eklendi! +- Bulunan kişi sayısındaki hata giderildi. + +v1.0 + +- GUI Düzenlendi, loglama mekanizması eklendi, stdout loglara yazdırıldı. +- Yeni durak isimleri eklendi. +- Mekanizmalar yeniden düzenlendi. + +- Ocak 2023 Gelecek Güncellemeler +- .exe sürümü yayımlanacak - DONE! +- logo eklenecek. +- hatalar giderilecek. +- Bildirim sistemi güncellenecek, sms ya da e posta eklenecek. +- tcdd chapta koruması tespiti yapılacak. + +# TCDD Bilet Kontrol + +- Uygulama TCDD sitesine özel tasarlanmıştır. + +- Uygulama seçilen dakika aralıklarında (1 - 10 dk) sorgu yapmaktadır + +- Bilet bulunursa telegram uzerinden mesaj gonderebilmektedir. + +- Bilet bulunursa sesli uyari ve popup uyarisinda bulunabilmektedir. + +### Kullanımı + +```sh +$ python main.py +``` + +ya da .exe dosyasini calistirabilirsiniz. + +Buradan indirebilirsiniz: [tcddBiletYerKontrol_v2.0.zip](https://github.com/mcagriaksoy/tcdd-bilet-yer-kontrol/releases/download/v2.0/TCDD.Bilet.Bulma.Botu.v2.0.zip) diff --git a/src/Control.py b/src/Control.py index 139d289..bd3befd 100644 --- a/src/Control.py +++ b/src/Control.py @@ -41,23 +41,25 @@ def sayfa_kontrol(self): sleep(1) xpath = ('//*[@id="mainTabView:gidisSeferTablosu_data"]/tr[' f'{row}]/td[1]/span') - aranan_element = WebDriverWait(self.driver, 10).until(EC.visibility_of_element_located( + aranan_element = WebDriverWait(self.driver, 50).until(EC.visibility_of_element_located( (By.XPATH, xpath))) aranan = aranan_element.text sleep(1) if self.zaman == aranan: - message_element = WebDriverWait(self.driver, 10).until(EC.visibility_of_element_located( + message_element = WebDriverWait(self.driver, 50).until(EC.visibility_of_element_located( (By.XPATH, f'//*[@id="mainTabView:gidisSeferTablosu:{row-1}:j_idt109:0:somVagonTipiGidis1_label"]'.format(row)))) message = message_element.text - match = re.search(r'\((\d+) \)', message) + + # Search pattern of ) ( + match = re.search(r'\) \(.', message) if match is None: sys.stdout.write( "\nSayfa yüklenirken hata oluştu...") return ErrCodes.TEKRAR_DENE - koltuk_sayisi = int(match.group(1)) + koltuk_sayisi = int(match.group()[3]) if koltuk_sayisi > 2: sys.stdout.write( - f"\nBoş koltuk sayısı: {koltuk_sayisi}") + f"\nTrende yeteri kadar bos ver mevcut!") return ErrCodes.BASARILI elif koltuk_sayisi == 2 or koltuk_sayisi == 1: sys.stdout.write( diff --git a/src/DriverSetting.py b/src/DriverSetting.py index d3cc5f4..1123f94 100644 --- a/src/DriverSetting.py +++ b/src/DriverSetting.py @@ -5,11 +5,13 @@ from selenium.webdriver import Edge from selenium.webdriver.edge.service import Service as EdgeService from webdriver_manager.microsoft import EdgeChromiumDriverManager - +from selenium.webdriver.edge.options import Options as EdgeOptions class DriverSetting: """Driver'ı ayarlar.""" def driver_init(self): - driver = Edge(service=EdgeService(EdgeChromiumDriverManager().install())) + options = EdgeOptions() + options.add_experimental_option('excludeSwitches', ['enable-logging']) + driver = Edge(service=EdgeService(EdgeChromiumDriverManager().install()), options=options) return driver diff --git a/src/__pycache__/Control.cpython-311.pyc b/src/__pycache__/Control.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c00e35f2197d58b1010ded96aebf4c6d1a79c1b8 GIT binary patch literal 5903 zcmcgwYitzP6}~h3@a}qz2MjjGHjHf^eqm!mURyiOVlTFFFaaBqY)m)foojo%k8$qI z1a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JN(Y@;_xcVY~P>dTUTvRuA%~241B$7 z|J4JZ{OmfL-ZhZfHE?s+$jYvfFIzH)=W_K87q>1wsc&ru#YUMlD#O&^Z>h7+^ zv0F`@nWlYl)rkE}dMd>rB^m<~pAK)c#rJ_2cP|;Y`Qy&5p5^jx*Ggko zmOliXnuaOnKmit@U$=HYf=V6oQVUy=!i{}BoF`u(d9an^vrXIbi=W73T|H=~q{fR&skJ(TA zb$-^$l--=kZq8&kw_e2(c4bVC(wWE1na9kT$JWpM&)21U>t|`MFT?feTwj*kY;CwS z*OK8{bgm^=wVA}UNj{ir?GkW#2tH|bVTO--p zt>=caUhby1amCx1_HNI3x9i^RxtfMd%^uyG&$;UERb+Q}t&yC!`ut&Q(khEKN-XS* z*Vr)KCa7l-HU@g@{_;9?@A~{bq*XUahEh2MXZx3jdS5{3F9-bf zQ2cd6AJD&5?x*xQKZ4@#KR1gn&=X_TwlAJ^Q~I3WIp(o_WoMxAmB#^eti6JMZ;1;r z910npP$&kTJWA`{Q0R3{h~}SEghHYm4u!}j5N&!*;)mKt$h`EMZi!G|WfB_nDMLWc z7Jpg0Pq+J4?Ka0YfV@CFc1HssSs>nL902US#F9bTx7UyWm9m=>juQG#AbWurm6#Bj zz^4&#{iKKXY=f^<5GH6b`spzy$GdUiL!e@Lc+=OLZoaWN^faEbKA03HO(m>1)Ec+7 zA&NFXFB6r}4+f-_%51t1qx`6DO|ssPCQ#IdYvBFh>a&o4j)3hD4a*d8HwfG$!vJiI z9bg0ELQLgZ5B+6PtzMq9$bHuQ-9p>-LSAKAW&{r1V^Jq!x^&c8nzQJ6y*y{p(|UPc Vbsl0Eu;l&e9kc(NA9-p*@?VD%W&Z#G literal 0 HcmV?d00001 diff --git a/src/__pycache__/DriverGet.cpython-311.pyc b/src/__pycache__/DriverGet.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..423cf7ee5e0c7df7f46b1c6309628113ef101c44 GIT binary patch literal 1892 zcmZ`(&1)M+6rcT&yq4v-E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zP#@vMP(%gJ)Ef^0YtA=fO>(is^ zAyoo4b{_zHihfLBA@wh|o(j*6LRAgijaSyWYn zxT;zXshb>6sOrPIX7)6asuD+6Rdx)V-Xk^z3p>i0+-LlGyBT0l2fvnh#uv}DMKOB3 zjSjOg3J*}sOt5KKgGp!swc&~7AJa-$j<9j(4=eH%+Me&-2gd(HSdzy$J#ba6@QLOv zLuZcbEO}wi{~N4#rx<@>jJF^>-YJd-N8Xob!zx{4=Rv`5w)+BDJAyH83j!9~h%*`C li$1zAJX+|cKRR0IhCezE+q6XqLje!7-(2?RABt|We*tppY5)KL literal 0 HcmV?d00001 diff --git a/src/__pycache__/Rota.cpython-311.pyc b/src/__pycache__/Rota.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d1e97f4bfa872b44c4628d00025209260119b1ad GIT binary patch literal 5080 zcmd5AU2GG{dDdP#u`^Db#4!mFZtntjm);R4fh)uT?vfBfAwMSq_hW)q8}B4pvTM7u zYltnkLe)tPQBKe&XoXZiAWFpxC$(>VIO%xlLn}M76l*1h8No^DUfOSVV<)~O z3fJmd#_MmtZ|3`EzQ39McK_h>c@ea}^e<LPU(UZY~o7pb@KTD3v*NBkUe zpb;c{zCg0~o&%u=@V8r}QLdXrojCa=(B45wC&Cp%btN7XK9Z8gT%3l5L50RuVOS&c zs`9=tXBY`R916`U#$0l`D;n2A(gdxv9lQY=d3%@d4~IgJ>?H@}u1{hmJhN*I{e z&ndg>kS!-=}2yBvrr_pGt}m zwS8qnZjE@p50G1kpa=(nbI4r8DLcME5ngrzbjdup)n)SM;)e8XH?T59m{!zT1r$_b ziXf?vzM|kPVU|$lS|LR!3=ttEr6t-Gb*(MLZY*9-_&+}Z;13=b5Ow3>`SDQ>)zH{G&jomoGlP~8yKcvP|+=~JbRBri(_VP@z=ouLgdiCGf^ z9c2VghAG-bt6n>tDKc_W^fGNQ6?kTo+u>0;} zpcT43i|~66d?;FR3J`AiTP|FvVJ`F_W5Z|$U9M0vSG`5D6=$+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gS{3)Q}X_zLtO{0s< zjxYL@hMIXcD}LPiYn)Cn`u)vX$i)9kXk|3`!)I%2YabqE>tFolL+k$Uzjpbbo#Dj) E0lKLukpKVy literal 0 HcmV?d00001 diff --git a/src/__pycache__/error_codes.cpython-311.pyc b/src/__pycache__/error_codes.cpython-311.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6fdd56e2eb4331bb14522c779c6ea3a8103ee0b7 GIT binary patch literal 501 zcmX|+J#X7E5QZuFOSUX4U+Ang1su;cnxbr?#6s&NkmQ9BASfam8MaJ=q6@e~p)Eh5 zW5*z4enavj1Wg4pWeE&q%M>!La|9mV3*NoFyE2Rx5b@#XukVlIzL#Ph%Kzl)y-0oo z3=qHyQm~3tTtO9FMO9owHC#t^+&~SiAq_V@u-jUkiH4RvOQKm!u=RtmY)og?=V-wb z%KFxjBq`z6?PYZLhuz&+aFWrbm2f`K`n}%8m?w+#y_lxGG>$IVIFiq;2RY7zDp8TB zO4KCk60rmpIN5EMjWEPC4#QISAoRll^r7dJZ6CVMV6BXUfqOc%*Rta~L;G~}R%{-R zknJABw|d>Tzq-&35A74X)V@GZn0<4~=D*By&^34x--G9)gMKi|#LmI%;AwD3vI(d2 zfX5iWqI*7`65d@B)}7E9XLK55EDi``l!Yc48-H? zW=5=VP*#&|!IByEES7ebW<*xo{b$5VJyJ_BQvWPRCE+b8653Tu!>@6xyS20Y**&+) zc3cVRW_!z(Q*~eG-h1x3=X~c@K5{s!Ft`f$|9Y}*Cx-neN|Y{R@#U*e;pG9wVB;8L zV2n{i%s6h0nZ`{9lr}}p<7Rl8qn4O;+#0itThx3@)E2|XarNCAC1O?MRR+w6vF7Wh zQU{OVuAMeXBu^+}GC>eDgqP@m3mr~0fOuU4O~ahLjZk9*Xocf5wd zZ)4-N3<0!`F@-RHRr2qko2ouqV5u7{FK~%C)k7!6=>#97`Zzujr3Pc{OqA=SrbTg9 z2p%{v#fj6&i9jR~J1{X9iwISN@o739VVSKAF0s=wR-~TYp`SnGpMO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TbE6(wezHKokW|+UAMC9gQn%CV&Tc0>y+#|CAm)hJ1X?846V6$N$y=++Cnji z#pPXQGC#}wEMMRBApJo)+yB^`tM8KQyOzz%=DfRR#k>r>-%$FpVP}?vcsp|;-_)87 z$W7gu5s>@J&t%{J3~aIT#5}&0+IwA@{+FAM%^?nlWAmU)1|>4M>DZiAkIj$B^-UdeNbZ$QezKNV~;b_2Qzb2Z^-=1 zhym1ME3iWV2*Izf5SG<{Bho{2?LPwihEWKuku%wRq>YEe$kBwu{68Xg@F$>?*#&If zjQ@P-_Rxa*)6h@7Vhe|vLeR){rIt7K};o4pH{(eEYZTu^^`%q5lXJXRx>?us$k7u4TN htVJr_dCVu3?t=9_lcBzVRZ!k)FxU&&R-&%n{{p7{-fjQ@ literal 0 HcmV?d00001 diff --git a/src/requirements.txt b/src/requirements.txt index 8e0f5f0..47afe93 100644 --- a/src/requirements.txt +++ b/src/requirements.txt @@ -1,4 +1,4 @@ -pygame==2.5.2 PySimpleGUI==4.60.5 selenium==4.18.1 webdriver_manager==4.0.1 +python-dotenv==1.0.1 diff --git a/src/ui.py b/src/ui.py index 045d050..adb54b7 100644 --- a/src/ui.py +++ b/src/ui.py @@ -5,12 +5,13 @@ """ from os import path, system -from sys import platform +import platform from datetime import date, datetime from time import sleep from threading import Thread -from pygame import mixer -from pygame import time as pyt + +if platform.system() == "Windows": + import winsound import Control import DriverGet @@ -53,25 +54,24 @@ def control(driver, time, delay_time, telegram_msg, bot_token, chat_id, ses): if response == ErrCodes.BASARILI: # Ses cal! if ses: - mixer.music.load(path.abspath("sound/notification.mp3")) - mixer.music.play() - while mixer.music.get_busy(): - pyt.Clock().tick(10) + for i in range(5): + if platform.system() == "Windows": + winsound.PlaySound("SystemExclamation", winsound.SND_ALIAS) + elif platform.system() == "Darwin" or platform.system() == "Linux": + os.system('play -n synth 0.1 sine 660') """ # Telegram mesaji gonder! if telegram_msg: TelegramMsg.TelegramMsg().send_telegram_message(bot_token, chat_id) """ sg.Popup( - "Hey Orada mısın? Biletin bulundu. Satın alabilirsin", + "Hey Orada mısın? Biletin bulundu. Satın alabilirsin ❤️❤️❤️❤️", keep_on_top=True, button_type=5, ) elif response == ErrCodes.TEKRAR_DENE: print("\n" + str(delay_time) + " Dakika icerisinde tekrar denenecek...") - mixer.music.load(path.abspath("sound/beep.mp3")) - mixer.music.play() else: window["Aramaya Başla"].update(disabled=False) @@ -90,7 +90,7 @@ def control(driver, time, delay_time, telegram_msg, bot_token, chat_id, ses): currentTime = now.strftime("%H:%M") sg.popup( - "Selam :)", + "💖 Selam, Hos geldin 💖", "Ilk defa kullaniyorsaniz, ilk taramada biraz bekleyebilirsiniz!", keep_on_top=True, ) @@ -204,26 +204,46 @@ def thread2(): t2.start() if event == "Aramaya Başla": - window["Aramaya Başla"].update(disabled=True) - window["Durdur!"].update(disabled=False) nereden = values["nereden"] nereye = values["nereye"] tarih = values["tarih"] saat = values["saat"] + + if saat == "": + sg.popup("Lütfen saat bilgisini giriniz!") + continue + elif tarih == "": + sg.popup("Lütfen tarih bilgisini giriniz!") + continue + elif nereden == nereye: + sg.popup("Nereden ve Nereye aynı olamaz!") + continue + + if "/" in tarih: + tarih = tarih.replace("/", ".") + elif "-" in tarih: + tarih = tarih.replace("-", ".") + + # If saat has , . replace with : + if "." in saat: + saat = saat.replace(".", ":") + elif "," in saat: + saat = saat.replace(",", ":") + delay_time = values["delay_time"] telegram_msg = values["telegram_msg"] bot_token = values["bot_token"] chat_id = values["chat_id"] ses = values["ses"] + + window["Aramaya Başla"].update(disabled=True) + window["Durdur!"].update(disabled=False) + print("Arama başladı. Lütfen bekleyin...") t1 = Thread( target=thread1, args=(delay_time, telegram_msg, bot_token, chat_id, ses) ) - mixer.init() - mixer.music.load(path.abspath("sound/beep.mp3")) - mixer.music.play() t1.start() - def __main__(): main()