Skip to content

Commit

Permalink
codes
Browse files Browse the repository at this point in the history
  • Loading branch information
Hakan Karapınar authored and Hakan Karapınar committed Nov 26, 2024
1 parent cdb8db1 commit d1bd7ec
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 37 deletions.
2 changes: 1 addition & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"program_settings": {
"mode": "2",
"proxy_protocol": "HTTP",
"proxy_usage": true,
"proxy_usage": false,
"thread_count": 1
},
"service_settings": {
Expand Down
47 changes: 22 additions & 25 deletions data/accounts.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
[email protected]|WIUEzISKFWSN|3:1727804395.5.0.1727804395467:1VCwsg:63d0.1.2:1|2031733475.0.2.3:1727804395|3:10296099.455640.A449lBbQsectimVH0mwzGQ9855A;
[email protected]|7tqsAOJt0cMf|3:1727804403.5.0.1727804403108:irLBWw:8378.1.2:1|2031733547.0.2.3:1727804403|3:10296099.804168.t95sqwipc9XDiBp2om1hywbchw0;
[email protected]|f43eWrRrq7cl|3:1727804408.5.0.1727804408088:H1OtHw:6cf1.1.2:1|2031733592.0.2.3:1727804408|3:10296099.579702.jf7ubr-ogZgWsnTA2RfDaV091H0;
[email protected]|PGTuW3XoUVnK|3:1727804418.5.0.1727804418676:VFSwsg:ed40.1.2:1|2031733689.0.2.3:1727804418|3:10296099.426402.N0TBYpixeAN4etzjz0QyJYlDuVw;
[email protected]|k3742XlgHEyU|3:1727804436.5.0.1727804436028:BJxxWQ:bfd5.1.2:1|2031733819.0.2.3:1727804436|3:10296099.803442.gyJcASJAAp8FoBwdt0Q8xM6SPTQ;
[email protected]|q4kA20YxUjMZ|3:1727804488.5.0.1727804488227:flewsg:ca78.1.2:1|2031734149.0.2.3:1727804488|3:10296099.293190.osd1u17C8U8oXkDBAPVWqeJeqSE;
[email protected]|MFJH8N59FeY6|3:1727804504.5.0.1727804504644:IZJxWQ:4506.1.2:1|2031734264.0.2.3:1727804504|3:10296099.676336.WAZvuNzklqtzFOt1C2T-yyeVZ_Q;
[email protected]|fMZwkG2PK3ZT|3:1727804531.5.0.1727804531108:UbHBWw:b0fd.1.2:1|2031734465.0.2.3:1727804531|3:10296099.962200.-0aXs5WbX5FFPs4Bx59yMWecNVA;
[email protected]|Po4RaEOQCgbx|3:1727804603.5.0.1727804603735:YaoZXg:1da6.1.2:1|2031734896.0.2.3:1727804603|3:10296099.365153.dh2t4PDks26vH4F4XazmPR0cO7A;
[email protected]|AYCunnuIRp0I|3:1727804614.5.0.1727804614464:LLHBWw:8c5c.1.2:1|2031734954.0.2.3:1727804614|3:10296099.507823.1cL3LfoANdvbgHQHPLM1rw-HoU0;
[email protected]|UNBqp12khNSF|3:1727804633.5.0.1727804633117:iJhxWQ:2ad0.1.2:1|2031735070.0.2.3:1727804633|3:10296099.993967.mOTozT8q6Rh-y8CkSg5i39LDT-k;
[email protected]|o6S4kgHEWT8K|3:1727804649.5.0.1727804649511:8a8ZXg:b40b.1.2:1|2031735186.0.2.3:1727804649|3:10296099.697675.59Xyvpva-cp3bEth1ANwQJdA97s;
[email protected]|dVbiNlEXwQok|3:1727804665.5.0.1727804665904:QVGtHw:d224.1.2:1|2031735281.0.2.3:1727804665|3:10296099.419205.85DMYryEfYbcbLgaDb6kppEd1uE;
[email protected]|vmnn0g75EjCS|3:1727804701.5.0.1727804701951:opFxWQ:3642.1.2:1|2031735496.0.2.3:1727804701|3:10296099.475935.cdvFHXP86dtZInx7fhWScDoHSdA;
[email protected]|aKfpaINwmFwV|3:1727804756.5.0.1727804756891:JrLBWw:25f1.1.2:1|2031735814.0.2.3:1727804756|3:10296099.294789.0dB6JaG8EWJU-5o4Blhf986wVbI;
[email protected]|DSQHY5NQBBt2|3:1727804765.5.0.1727804765411:npZxWQ:3289.1.2:1|2031735862.0.2.3:1727804765|3:10296099.677147.hEP3QnWoJFdA58qHU2Gd8szA_P0;
[email protected]|4Yt462ozNEeE|3:1727804816.5.0.1727804816934:ZpJxWQ:195c.1.2:1|2031736152.0.2.3:1727804816|3:10296099.806324.euxQ3mDKIwFQxwGc6h-QoiTk034;
[email protected]|xNdl8Zm0Sj5a|3:1727804831.5.0.1727804831838:OLPBWw:145a.1.2:1|2031736229.0.2.3:1727804831|3:10296099.893204.piaipBbugPLujTANIgS_p05mcO0;
[email protected]|XzfEvMjBggMD|3:1727804840.5.0.1727804840994:WZJxWQ:c55c.1.2:1|2031736293.0.2.3:1727804840|3:10296099.581025.5vHSPRe_VSUFS7_KiSpadB1XWuM;
[email protected]|dbaOnNOsTuMO|3:1727804851.5.0.1727804851430:qrDBWw:ea73.1.2:1|2031736354.0.2.3:1727804851|3:10296099.802100.AztUBM4orO7ih10egYS40H5XEME;
[email protected]|8IEyaJdEjkME|3:1727804859.5.0.1727804859334:j1GtHw:3da8.1.2:1|2031736407.0.2.3:1727804859|3:10296099.164222.DmkpEhcslLG-ji9wUf3QCnuol68;
[email protected]|vASAfuEyxjwZ|3:1727804893.5.0.1727804893920:ZrPBWw:f22a.1.2:1|2031736590.0.2.3:1727804893|3:10296099.688570.aduA5oYZmUA1lNZQVfJdJqa3A1k;
[email protected]|oD2vnAaICsic|3:1727804912.5.0.1727804912982:a1Gwsg:6712.1.2:1|2031736697.0.2.3:1727804912|3:10296099.184650.KAQZu6thG3hmldU0Qo-6Il9lvJg;
[email protected]|8uEXK5vdq94A|3:1727804939.5.0.1727804939453:S-zcUw:7057.1.2:1|2031736832.0.2.3:1727804939|3:10296099.721046.IAnLHn66LAjvqKKGZgkoi8VYAXs;
[email protected]|uPdR5bMkCDys|3:1727804954.5.0.1727804954397:6rDBWw:a376.1.2:1|2031736912.0.2.3:1727804954|3:10296099.558097.snVjuhklSirnPwDZt95OLsCs7zM;
[email protected]|7aol2VFqLSBj|3:1727805555.5.0.1727805555498:a1Gwsg:ed40.1.2:1|2031740515.0.2.3:1727805555|3:10296099.731731.oelzSw6FtgW1aYpKkQiAYQmaiOg;
[email protected]|VrO4eR2nUXWF|3:1727805567.5.0.1727805567325:OVetHw:f22a.1.2:1|2031740578.0.2.3:1727805567|3:10296099.672147.nh9RlYiYsj9dre0EC_2srH6nEdo;
[email protected]|Imt6fbNYbkL5|3:1727805579.5.0.1727805579722:A59xWQ:b0cc.1.2:1|2031740650.0.2.3:1727805579|3:10296099.263295.Z6BQ0s3g-hNTHe3LnyBsBEowM3k;
[email protected]|ayRftOmfaxpf|3:1727805596.5.0.1727805596656:mJVxWQ:adee.1.2:1|2031740747.0.2.3:1727805596|3:10296099.435418.jdVOFPyClUsdTi0-J2uwW2ZO85E;
[email protected]|0FW9eRbdVYTR|3:1727805638.5.0.1727805638724:vpZxWQ:b90d.1.2:1|2031741005.0.2.3:1727805638|3:10296099.926562.Acw8uWOJownUKBQnsGKemdEQaLA;
[email protected]|oe0mA9VbVfqi|3:1727805638.5.0.1727805638983:xLPBWw:3289.1.2:1|2031741006.0.2.3:1727805638|3:10296099.358834.f1VUFx0ks5OmpezwU5U8pejXW_w;
[email protected]|PJIiBtu14vUn|3:1727805667.5.0.1727805667240:B-_cUw:b90d.1.2:1|2031741159.0.2.3:1727805667|3:10296099.376362.RPVgYpE6rZchmwvfAIiY93XxNfI;
[email protected]|GCkIswUWM1ah|3:1727805679.5.0.1727805679953:OJNxWQ:e190.1.2:1|2031741243.0.2.3:1727805679|3:10296099.318237.Kn_xawvx6eqzAXbptEWLRLBBRgE;
[email protected]|UaU5ifec3G85|3:1727805700.5.0.1727805700038:T-zcUw:adee.1.2:1|2031741365.0.2.3:1727805700|3:10296099.323965.aOaZEz-HAyBwkcwF1eo3czkJFjU;
[email protected]|Vfbylwed4uct|3:1727805722.5.0.1727805722696:_qkZXg:1282.1.2:1|2031741498.0.2.3:1727805722|3:10296099.81055.fDwUEMl9wBgqivKftqBCPB8BsTc;
[email protected]|pLtw1hhpgV0h|3:1727805736.5.0.1727805736523:Z5VxWQ:1176.1.2:1|2031741582.0.2.3:1727805736|3:10296099.424934.KbYbAz0ATBMHi9XXXwjmYUnIz6A;
[email protected]|AJUgae7W8ktT|3:1727805774.5.0.1727805774919:OZpxWQ:63d0.1.2:1|2031741804.0.2.3:1727805774|3:10296099.809968.32xBjkyq2wDBNYXvU-mHmm15bp8;
[email protected]|rXtyUjeliGZo|3:1727805776.5.0.1727805776230:kZ9xWQ:128e.1.2:1|2031741813.0.2.3:1727805776|3:10296099.3537.GfaqYxK3FszhqZz7TX0qY8IONxQ;
[email protected]|YUFf3pIuQ286|3:1727805806.5.0.1727805806732:K5lxWQ:471c.1.2:1|2031741994.0.2.3:1727805806|3:10296099.172787.pzEoAuzvdLCyqV7We89FCeuY2V0;
[email protected]|Yz0WYHZA7uvZ|3:1727805838.5.0.1727805838258:FpRxWQ:4017.1.2:1|2031742165.0.2.3:1727805838|3:10296099.198907.XFYzn4QVlUhWvXpy9gT8Irrh_Nc;
[email protected]|Q1c2XmNFdJdo|3:1727805872.5.0.1727805872768:Rp5xWQ:b305.1.2:1|2031742372.0.2.3:1727805872|3:10296099.424896.610flN-Hb92Nj4Yi8QApnUvaQO4;
[email protected]|tZun7tZaIFAF|3:1727805882.5.0.1727805882248:CJlxWQ:dd00.1.2:1|2031742435.0.2.3:1727805882|3:10296099.371420.8fq5cD69wvXCWk5BCiwWRn6KMm0;
[email protected]|G8Um0vRMRz8e|3:1727805891.5.0.1727805891070:VpRxWQ:74ad.1.2:1|2031742496.0.2.3:1727805891|3:10296099.899385.D913vZGTGinoO-EwuWaKgV6bgKI;
[email protected]|8w8ExiJUQXGd|3:1727805940.5.0.1727805940697:hO7cUw:4f0e.1.2:1|2031742812.0.2.3:1727805940|3:10296099.632278.0_YJUPAiKF09neitQSrXGOhVZb0;
[email protected]|8kAzFcVdgxbA|3:1727805966.5.0.1727805966499:u6gZXg:1964.1.2:1|2031742969.0.2.3:1727805966|3:10296099.210474.Qr-J5Rz-Izd9wSh3FRGPONdgcAw;
[email protected]|Snj14Nr6UxYy|3:1727805989.5.0.1727805989295:yLPBWw:dd00.1.2:1|2031743093.0.2.3:1727805989|3:10296099.554241.0EW6H-eZcG1Do-rgaEL7JBviGhE;
[email protected]|bImhLIEKcES4|3:1727806028.5.0.1727806028981:35VxWQ:63d0.1.2:1|2031743338.0.2.3:1727806028|3:10296099.68085.yrOVY6HZkwGuRaU7CCDMvTTGcQA;
Binary file modified source/core/__pycache__/launcher.cpython-313.pyc
Binary file not shown.
24 changes: 13 additions & 11 deletions source/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,13 @@ def only_create(self) -> None:
logger.info(f"Account creation completed. Total accounts created: {self.created_accounts}")

def only_stream_worker(self) -> None:
cookie_files = YandexUtils.load_cookie_files()
random.shuffle(cookie_files) # Her thread için farklı bir sıralama
print(cookie_files)

if LOADER_TYPE == 0:
cookie_files = YandexUtils.load_cookie_files()
random.shuffle(cookie_files)
elif LOADER_TYPE == 1:
cookie_files = YandexUtils().load_account_list()
random.shuffle(cookie_files)

while not self.stop_event.is_set():
task = None
with self.lock:
Expand All @@ -262,19 +265,18 @@ def only_stream_worker(self) -> None:
break

session = self.create_session(type=2)
cookies_dict = BotUtils.load_cookies(self.COOKIES_DIR, cookie_file)
YandexUtils.load_cookies_from_file(session=session, cookies_dict=cookies_dict)

if LOADER_TYPE == 0:
cookies_dict = BotUtils.load_cookies(self.COOKIES_DIR, cookie_file)
YandexUtils.load_cookies_from_file(session=session, cookies_dict=cookies_dict)
elif LOADER_TYPE == 1:
session_id = "|".join(cookie_file.split("|")[2:])
session.cookies.update({"Session_id": session_id})
for _ in range(task["stream_each_account"]):
if self.stop_event.is_set() or task["current_stream"] >= task["total_stream_count"]:
break

if self.stream(session, session.headers['User-Agent'], task):
logger.info(f"Stream sent for task {task['url']} using account {cookie_file}")
#with self.lock:
# task["current_stream"] += 1
# task["listener_count"] += 1
# self.update_task_backend(task["id"])
else:
logger.warning(f"Failed to stream for task {task['url']} using account {cookie_file}")

Expand Down
Binary file modified source/utils/__pycache__/functions.cpython-313.pyc
Binary file not shown.
19 changes: 19 additions & 0 deletions source/utils/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,25 @@ def load_cookie_files() -> Optional[List[str]]:
print(f"No .cookies files found in directory: {cookies_dir}")
return False
return cookie_files


@staticmethod
def load_account_list() -> Optional[List[str]]:
path_to_data = './data'
accounts_file = os.path.join(path_to_data, "accounts.txt")
if not os.path.exists(accounts_file):
logger.error(f"Accounts file not found: {accounts_file}")
return []
try:
with open(accounts_file, 'r', encoding='utf-8') as file:
accounts = [line.strip() for line in file if line.strip()] # Remove empty lines and whitespace
if not accounts:
print(f"No accounts found in file: {accounts_file}")
return []
return accounts
except Exception as e:
logger.error(f"Error reading accounts file: {e}")
return []

@staticmethod
def format_cookie_string(cookie_string: str) -> str:
Expand Down

0 comments on commit d1bd7ec

Please sign in to comment.