|
21 | 21 | dpg.add_font_range(0x0020, 0xFFFD) |
22 | 22 |
|
23 | 23 |
|
24 | | -dpg.create_viewport(title="LiveTL", small_icon='128x128.ico') |
| 24 | +dpg.create_viewport(title="LiveTL", small_icon='128x128.ico', height=720, width = 1280) |
25 | 25 | dpg.setup_dearpygui() |
26 | 26 | dpg.bind_font(default_font) |
27 | 27 | #dpg.show_font_manager() |
28 | 28 |
|
29 | | -player = mpv.MPV(ytdl=True, geometry='1280x720+100+100') |
| 29 | +player = mpv.MPV(ytdl=True, geometry='1280x720+100+100', volume='75') |
30 | 30 |
|
31 | 31 | w, h, d = 1280, 720, 3 |
32 | 32 |
|
|
35 | 35 | def run_chat(): |
36 | 36 | while chat.is_alive(): |
37 | 37 | for c in chat.get().sync_items(): |
38 | | - if c.message: |
39 | | - dpg.set_value('chat_text', f'{c.author.name}:{c.message}\n' + dpg.get_value('chat_text')) |
40 | | - dpg.set_value('chat_text_translated', f'{c.author.name}:{translator.translate(c.message, dest=dpg.get_value("translated_chat_language")).text}\n' + dpg.get_value('chat_text_translated')) |
41 | | - if parseTranslation(c, dpg.get_value('translation_filter_language')): |
42 | | - dpg.set_value('filtered_text', f'{c.author.name}:{parseTranslation(c, dpg.get_value("translation_filter_language"))[1]}\n' + dpg.get_value('filtered_text')) |
| 38 | + try: |
| 39 | + if c.message: |
| 40 | + dpg.set_value('chat_text', f'{c.author.name}:{c.message}\n' + dpg.get_value('chat_text')) |
| 41 | + dpg.set_value('chat_text_translated', f'{c.author.name}:{translator.translate(c.message, dest=dpg.get_value("translated_chat_language")).text}\n' + dpg.get_value('chat_text_translated')) |
| 42 | + if parseTranslation(c, dpg.get_value('translation_filter_language')): |
| 43 | + dpg.set_value('filtered_text', f'{c.author.name}:{parseTranslation(c, dpg.get_value("translation_filter_language"))[1]}\n' + dpg.get_value('filtered_text')) |
| 44 | + except Exception as e: |
| 45 | + print(e) |
43 | 46 |
|
44 | 47 | chat_thread = threading.Thread(target=run_chat) |
45 | 48 |
|
|
0 commit comments