atalaydenknalbant / autosubscriber-youtube

Python Selenium-based automated subscribing, liking,viewing functions for youtube sub4sub websites.
GNU General Public License v3.0
29 stars 10 forks source link

how to fix? #36

Closed Rambooo69 closed 1 year ago

Rambooo69 commented 1 year ago

Running Local Version

DevTools listening on ws://127.0.0.1:50485/devtools/browser/f05c6cd7-7cd4-4a95-8eef-077dcafed620 [0320/194624.325:ERROR:command_buffer_proxyimpl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer. [0320/194625.579:INFO:CONSOLE(261)] "%c%s color: red; background: yellow; font-size: 24px; WARNING!", source: https://www.gstatic.com//mss/boq-identity/_/js/k=boq-identity.AccountsSignInUi.en_US.4-aFTfKbiAQ.es5.O/am=wONwwCCQOAeTIQAAAAAAAAAAwGJoAgI/d=1/excm=_b,_r,_tp,identifierview/ed=1/dg=0/wt=2/rs=AOaEmlFwqiUbmB4kld-sTHp0hzw05P2NpA/m=_b,_tp,r (261) [0320/194625.579:INFO:CONSOLE(261)] "%c%s font-size: 18px; Using this console may allow attackers to impersonate you and steal your information using an attack called Self-XSS. Do not enter or paste code that you do not understand.", source: https://www.gstatic.com//mss/boq-identity/_/js/k=boq-identity.AccountsSignInUi.en_US.4-aFTfKbiAQ.es5.O/am=wONwwCCQOAeTIQAAAAAAAAAAwGJoAgI/d=1/excm=_b,_r,_tp,identifierview/ed=1/dg=0/wt=2/rs=AOaEmlFwqiUbmB4kld-sTHp0hzw05P2NpA/m=_b,_tp,_r (261) [0320/194626.070:INFO:CONSOLE(0)] "An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.", source: https://accounts.youtube.com/accounts/CheckConnection?pmpo=https%3A%2F%2Faccounts.google.com&v=373391443&timestamp=1679321785777 (0) [0320/194626.290:ERROR:web_contents_delegate.cc(239)] WebContentsDelegate::CheckMediaAccessPermission: Not supported. [0320/194626.290:ERROR:web_contents_delegate.cc(239)] WebContentsDelegate::CheckMediaAccessPermission: Not supported. Traceback (most recent call last): File "C:\Users\daxvi.VINIDESK\OneDrive\Desktop\autosubscriber-youtube-1.9951\ytmonster.py", line 42, in sws.ytmonster_functions(required_dict) File "C:\Users\daxvi.VINIDESK\OneDrive\Desktop\autosubscriber-youtube-1.9951\selenium_codes\sub4sub_websites_selenium.py", line 843, in ytmonster_functions google_login(driver, req_dict, has_login_btn=False) File "C:\Users\daxvi.VINIDESK\OneDrive\Desktop\autosubscriber-youtube-1.9951\selenium_codes\sub4sub_websites_selenium.py", line 200, in google_login pw_area = driver.find_element(By.CSS_SELECTOR, "#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 830, in find_element return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute self.error_handler.check_response(response) File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input"} (Session info: headless chrome=111.0.5563.65) Stacktrace: Backtrace: (No symbol) [0x0076DCE3] (No symbol) [0x007039D1] (No symbol) [0x00614DA8] (No symbol) [0x0064019F] (No symbol) [0x006403AB] (No symbol) [0x0066EE62] (No symbol) [0x0065AF14] (No symbol) [0x0066D57C] (No symbol) [0x0065ACC6] (No symbol) [0x00636F68] (No symbol) [0x006380CD] GetHandleVerifier [0x009E3832+2506274] GetHandleVerifier [0x00A19794+2727300] GetHandleVerifier [0x00A1E36C+2746716] GetHandleVerifier [0x00816690+617600] (No symbol) [0x0070C712] (No symbol) [0x00711FF8] (No symbol) [0x007120DB] (No symbol) [0x0071C63B] BaseThreadInitThunk [0x76656BD9+25] RtlGetFullPathName_UEx [0x777F8FD2+1218] RtlGetFullPathName_UEx [0x777F8F9D+1165]

atalaydenknalbant commented 1 year ago

add driver.save_screenshot("screenshots/screenshot.png") to line 199 and send me the screenshot

Rambooo69 commented 1 year ago

screenshot

atalaydenknalbant commented 1 year ago

might be implicit wait is not enough or something add this to line after screenshot

    try:
        pw_area = driver.find_element(By.CSS_SELECTOR, "#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input")
    except Exception:
        driver.save_screenshot("screenshot.png")
        return
Rambooo69 commented 1 year ago

Running Local Version

DevTools listening on ws://127.0.0.1:49881/devtools/browser/0cc32615-3c83-4798-ae6a-097eabaaeae8 [0321/211859.171:INFO:CONSOLE(261)] "%c%s color: red; background: yellow; font-size: 24px; WARNING!", source: https://www.gstatic.com/_/mss/boq-identity/_/js/k=boq-identity.AccountsSignInUi.en_US.4-aFTfKbiAQ.es5.O/am=wONwwCCQOAeTIQAAAAAAAAAAwGJoAgI/d=1/excm=_b,_r,_tp,identifierview/ed=1/dg=0/wt=2/rs=AOaEmlFwqiUbmB4kld-sTHp0hzw05P2NpA/m=_b,_tp,_r (261) [0321/211859.171:INFO:CONSOLE(261)] "%c%s font-size: 18px; Using this console may allow attackers to impersonate you and steal your information using an attack called Self-XSS. Do not enter or paste code that you do not understand.", source: https://www.gstatic.com/_/mss/boq-identity/_/js/k=boq-identity.AccountsSignInUi.en_US.4-aFTfKbiAQ.es5.O/am=wONwwCCQOAeTIQAAAAAAAAAAwGJoAgI/d=1/excm=_b,_r,_tp,identifierview/ed=1/dg=0/wt=2/rs=AOaEmlFwqiUbmB4kld-sTHp0hzw05P2NpA/m=_b,_tp,_r (261) [0321/211859.864:INFO:CONSOLE(0)] "An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.", source: https://accounts.youtube.com/accounts/CheckConnection?pmpo=https%3A%2F%2Faccounts.google.com&v=1277818492&timestamp=1679413739568 (0) [0321/211900.073:ERROR:web_contents_delegate.cc(239)] WebContentsDelegate::CheckMediaAccessPermission: Not supported. [0321/211900.073:ERROR:web_contents_delegate.cc(239)] WebContentsDelegate::CheckMediaAccessPermission: Not supported. 2023-03-21 21:19:09,910 - INFO - YouTube login completed Traceback (most recent call last): File "C:\Users\daxvi.VINIDESK\OneDrive\Desktop\autosubscriber-youtube-1.9951\ytmonster.py", line 42, in sws.ytmonster_functions(required_dict) File "C:\Users\daxvi.VINIDESK\OneDrive\Desktop\autosubscriber-youtube-1.9951\selenium_codes\sub4sub_websites_selenium.py", line 858, in ytmonster_functions driver.execute_script("document.querySelector('#endAll').click()") File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 500, in execute_script return self.execute(command, {"script": script, "args": converted_args})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute self.error_handler.check_response(response) File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read properties of null (reading 'click') (Session info: headless chrome=111.0.5563.65) Stacktrace: Backtrace: (No symbol) [0x0109DCE3] (No symbol) [0x010339D1] (No symbol) [0x00F44DA8] (No symbol) [0x00F476FB] (No symbol) [0x00F475D0] (No symbol) [0x00F47EB0] (No symbol) [0x00F9DEED] (No symbol) [0x00F8AECC] (No symbol) [0x00F9D57C] (No symbol) [0x00F8ACC6] (No symbol) [0x00F66F68] (No symbol) [0x00F680CD] GetHandleVerifier [0x01313832+2506274] GetHandleVerifier [0x01349794+2727300] GetHandleVerifier [0x0134E36C+2746716] GetHandleVerifier [0x01146690+617600] (No symbol) [0x0103C712] (No symbol) [0x01041FF8] (No symbol) [0x010420DB] (No symbol) [0x0104C63B] BaseThreadInitThunk [0x769B6B89+25] RtlGetFullPathName_UEx [0x77648F9F+1215] RtlGetFullPathName_UEx [0x77648F6D+1165]

atalaydenknalbant commented 1 year ago

Update the latest version 1.996 then at line 844 change implicity wait to longer times 15-20

driver.implicitly_wait(15)
Rambooo69 commented 1 year ago

Running Local Version

DevTools listening on ws://127.0.0.1:50030/devtools/browser/729a5909-1879-4f67-b95a-d733ed60d2a8 [0321/214804.632:ERROR:command_buffer_proxyimpl.cc(128)] ContextResult::kTransientFailure: Failed to send GpuControl.CreateCommandBuffer. [0321/214805.780:INFO:CONSOLE(261)] "%c%s color: red; background: yellow; font-size: 24px; WARNING!", source: https://www.gstatic.com//mss/boq-identity/_/js/k=boq-identity.AccountsSignInUi.en_US.4-aFTfKbiAQ.es5.O/am=wONwwCCQOAeTIQAAAAAAAAAAwGJoAgI/d=1/excm=_b,_r,_tp,identifierview/ed=1/dg=0/wt=2/rs=AOaEmlFwqiUbmB4kld-sTHp0hzw05P2NpA/m=_b,_tp,r (261) [0321/214805.780:INFO:CONSOLE(261)] "%c%s font-size: 18px; Using this console may allow attackers to impersonate you and steal your information using an attack called Self-XSS. Do not enter or paste code that you do not understand.", source: https://www.gstatic.com//mss/boq-identity/_/js/k=boq-identity.AccountsSignInUi.en_US.4-aFTfKbiAQ.es5.O/am=wONwwCCQOAeTIQAAAAAAAAAAwGJoAgI/d=1/excm=_b,_r,_tp,identifierview/ed=1/dg=0/wt=2/rs=AOaEmlFwqiUbmB4kld-sTHp0hzw05P2NpA/m=_b,_tp,_r (261) [0321/214806.328:INFO:CONSOLE(0)] "An iframe which has both allow-scripts and allow-same-origin for its sandbox attribute can remove its sandboxing.", source: https://accounts.youtube.com/accounts/CheckConnection?pmpo=https%3A%2F%2Faccounts.google.com&v=-226686700&timestamp=1679415485998 (0) [0321/214806.541:ERROR:web_contents_delegate.cc(239)] WebContentsDelegate::CheckMediaAccessPermission: Not supported. [0321/214806.541:ERROR:web_contents_delegate.cc(239)] WebContentsDelegate::CheckMediaAccessPermission: Not supported. Traceback (most recent call last): File "C:\Users\daxvi.VINIDESK\OneDrive\Desktop\autosubscriber-youtube-1.9951\ytmonster.py", line 42, in sws.ytmonster_functions(required_dict) File "C:\Users\daxvi.VINIDESK\OneDrive\Desktop\autosubscriber-youtube-1.9951\selenium_codes\sub4sub_websites_selenium.py", line 846, in ytmonster_functions google_login(driver, req_dict, has_login_btn=False) File "C:\Users\daxvi.VINIDESK\OneDrive\Desktop\autosubscriber-youtube-1.9951\selenium_codes\sub4sub_websites_selenium.py", line 200, in google_login pw_area = driver.find_element(By.CSS_SELECTOR, "#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 830, in find_element return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute self.error_handler.check_response(response) File "C:\Users\daxvi.VINIDESK\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input"} (Session info: headless chrome=111.0.5563.65) Stacktrace: Backtrace: (No symbol) [0x0109DCE3] (No symbol) [0x010339D1] (No symbol) [0x00F44DA8] (No symbol) [0x00F7019F] (No symbol) [0x00F703AB] (No symbol) [0x00F9EE62] (No symbol) [0x00F8AF14] (No symbol) [0x00F9D57C] (No symbol) [0x00F8ACC6] (No symbol) [0x00F66F68] (No symbol) [0x00F680CD] GetHandleVerifier [0x01313832+2506274] GetHandleVerifier [0x01349794+2727300] GetHandleVerifier [0x0134E36C+2746716] GetHandleVerifier [0x01146690+617600] (No symbol) [0x0103C712] (No symbol) [0x01041FF8] (No symbol) [0x010420DB] (No symbol) [0x0104C63B] BaseThreadInitThunk [0x769B6B89+25] RtlGetFullPathName_UEx [0x77648F9F+1215] RtlGetFullPathName_UEx [0x77648F6D+1165]

atalaydenknalbant commented 1 year ago

again change line 200 with this code instead and send me the screenshot

    try:
        pw_area = driver.find_element(By.CSS_SELECTOR, "#password > div.aCsJod.oJeWuf > div > div.Xb9hP > input")
    except Exception:
        driver.save_screenshot("screenshot.png")
        return
Rambooo69 commented 1 year ago

I think its working now.

atalaydenknalbant commented 1 year ago

ok great you can increase time in implicity wait if something like this happens.

driver.implicitly_wait(15)