Code Monkey home page Code Monkey logo

selenium_youtube's Introduction

selenium_youtube

PyPI - package version PyPI - license PyPI - python version PyPI - downloads

GitHub - last commit GitHub - commit activity

GitHub - code size in bytes GitHub - repo size GitHub - lines of code

GitHub - license

Description

selenium implementation of youtube, which can upload/watch/like/comment/pin comment on videos

Install

pip install selenium_youtube
# or
pip3 install selenium_youtube

Usage

from selenium_youtube import Youtube

# pip install selenium_firefox
from selenium_firefox import Firefox
firefox = Firefox()

# pip install selenium_chrome
from selenium_chrome import Chrome
chrome = Chrome()

youtube = Youtube(
    browser=chrome # or firefox
)

upload_result = youtube.upload('path_to_video', 'title', 'description', ['tag1', 'tag2'])

Dependencies

beautifulsoup4, kcu, kstopit, kyoutubescraper, noraise, selenium, selenium-browser, selenium-chrome, selenium-firefox, selenium-uploader-account, setuptools, xpath-utils

Credits

Péntek Zsolt

selenium_youtube's People

Contributors

kkristof200 avatar yanncabral avatar zselter07 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

selenium_youtube's Issues

Error not upload

Youtube - cookies - Successfully logged in. Saving cookies.
Youtube - cookies - Upload: uploaded video
move_to_element: None element passed
Youtube - cookies - Upload: added title
Youtube - cookies - Message: element click intercepted: Element

is not clickable at point (556, 438). Other element would receive the click:

(Session info: chrome=93.0.4577.63)
Stacktrace:
0 chromedriver 0x000000010109b829 chromedriver + 2730025
1 chromedriver 0x0000000101758f43 chromedriver + 9797443
2 chromedriver 0x0000000100e2d958 chromedriver + 182616
3 chromedriver 0x0000000100e69024 chromedriver + 426020
4 chromedriver 0x0000000100e66c7e chromedriver + 416894
5 chromedriver 0x0000000100e6449a chromedriver + 406682
6 chromedriver 0x0000000100e63147 chromedriver + 401735
7 chromedriver 0x0000000100e57208 chromedriver + 352776
8 chromedriver 0x0000000100e7ef72 chromedriver + 515954
9 chromedriver 0x0000000100e56f95 chromedriver + 352149
10 chromedriver 0x0000000100e7f1ee chromedriver + 516590
11 chromedriver 0x0000000100e91464 chromedriver + 590948
12 chromedriver 0x0000000100e7f193 chromedriver + 516499
13 chromedriver 0x0000000100e558be chromedriver + 346302
14 chromedriver 0x0000000100e56b25 chromedriver + 351013
15 chromedriver 0x0000000101062f8f chromedriver + 2498447
16 chromedriver 0x0000000101075a61 chromedriver + 2574945
17 chromedriver 0x000000010104876b chromedriver + 2389867
18 chromedriver 0x0000000101076eda chromedriver + 2580186
19 chromedriver 0x0000000101058ffc chromedriver + 2457596
20 chromedriver 0x0000000101090148 chromedriver + 2683208
21 chromedriver 0x00000001010902d1 chromedriver + 2683601
22 chromedriver 0x00000001010a0848 chromedriver + 2750536
23 libsystem_pthread.dylib 0x00007fff2046e8fc _pthread_start + 224
24 libsystem_pthread.dylib 0x00007fff2046a443 thread_start + 15

(False, None)

Process finished with exit code 0

Module not compatible with windows

    signal.signal(signal.SIGALRM, self.handle_timeout)
AttributeError: module 'signal' has no attribute 'SIGALRM'. Did you mean: 'SIGABRT'?

After researching, i found we are not able to SIGABRT in windows. I think the issue is with kstopit repo

Please make commit messages that make sense

image
This is just ridiculous. It's uninformative. I'm trying to track down the differences between 2.0.30 and 2.0.31 because there are no releases, and this just makes it even worse.

Extensions and cookies

'path_to_cookies_folder',
what format should the file be and what should be specified in it?
and this too
'path_to_extensions_folder'
Help please

RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase.

I'm having the following issue, any help would be appreciated. I'm using Python 3.10.2.

chrome = Chrome()
youtube = Youtube(
    browser=chrome
)

result = youtube.upload(video_path=video_path,
               title=title,
               description=description,
               tags=tags,
               made_for_kids=made_for_kids,
               visibility=visibility,
               # thumbnail_images_path=thumbnail_images_path,
               timeout=timeout)`

Here is the stack trace:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
    prepare(preparation_data)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
    _fixup_main_from_path(data['init_main_from_path'])
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
    main_content = runpy.run_path(main_path,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 269, in run_path
    return _run_module_code(code, init_globals, run_name,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 96, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/Users/user/Documents/Projects/testproject/main.py", line 444, in <module>
    testUpload()
  File "/Users/user/Documents/Projects/testproject/main.py", line 136, in testUpload
    uploadVideo("test-vid.mp4")
  File "/Users/user/Documents/Projects/testproject/main.py", line 358, in uploadVideo
    chrome = Chrome()
  File "/Users/user/Documents/Projects/testproject/lib/python3.10/site-packages/selenium_chrome/chrome.py", line 113, in __init__
    super().__init__(
  File "/Users/user/Documents/Projects/testproject/lib/python3.10/site-packages/selenium_browser/selenium_browser.py", line 62, in __init__
    self.driver = webdriver_class(**webdriver_kwargs)
  File "/Users/user/Documents/Projects/testproject/lib/python3.10/site-packages/undetected_chromedriver/__init__.py", line 392, in __init__
    self.browser_pid = start_detached(
  File "/Users/user/Documents/Projects/testproject/lib/python3.10/site-packages/undetected_chromedriver/dprocess.py", line 39, in start_detached
    ).start()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/context.py", line 224, in _Popen
    return _default_context.get_context().Process._Popen(process_obj)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/context.py", line 284, in _Popen
    return Popen(process_obj)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
RuntimeError: 
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.

Is this still working?

Any other alternatives to this? Youtube API is useless and all the videos straightaway go to Private.

Thanks in advance for any suggestions.

Can you please let us know how we can load cookies

Your work is awesome but how do i load the cookies in the browser. I am still new to selenium and i looked up in all your other project as well but still trying to figure it out.
Waiting for your reply

element not interactable

Hello, can you ensure the script waits for elements to be interactable. Because it errors like this ~75% of the time for me.

Youtube - cookies - Upload: uploaded video
__dismiss_welcome_popup_2
__dismiss_welcome_popup
__dismiss_callouts
__dismiss_welcome_popup_2
__dismiss_welcome_popup
__dismiss_callouts
Youtube - cookies - Message: element not interactable
(Session info: chrome=105.0.5195.54)
Stacktrace:
Backtrace:
Ordinal0 [0x00D0DF13+2219795]
Ordinal0 [0x00CA2841+1779777]
Ordinal0 [0x00BB4100+803072]
Ordinal0 [0x00BDB601+964097]
Ordinal0 [0x00BFE7FC+1107964]
Ordinal0 [0x00BD94B4+955572]
Ordinal0 [0x00BFEA14+1108500]
Ordinal0 [0x00C0F192+1175954]
Ordinal0 [0x00BFE616+1107478]
Ordinal0 [0x00BD7F89+950153]
Ordinal0 [0x00BD8F56+954198]
GetHandleVerifier [0x01002CB2+3040210]
GetHandleVerifier [0x00FF2BB4+2974420]
GetHandleVerifier [0x00DA6A0A+565546]
GetHandleVerifier [0x00DA5680+560544]
Ordinal0 [0x00CA9A5C+1808988]
Ordinal0 [0x00CAE3A8+1827752]
Ordinal0 [0x00CAE495+1827989]
Ordinal0 [0x00CB80A4+1867940]
BaseThreadInitThunk [0x76306739+25]
RtlGetFullPathName_UEx [0x77388FD2+1218]
RtlGetFullPathName_UEx [0x77388F9D+1165]

ImportError

ImportError: cannot import name 'Youtube' from partially initialized module 'selenium_youtube' (most likely due to a circular import) (C:\Program Files\Python310\lib\site-packages\selenium_youtube_init_.py)

documentation

hi

can you give more examples, like how to use more options, how to set visibility other than public, or disable publishing - just upload and leave as draft, how to use headlessly etc.. ?

unexpected keyword argument 'firefox_options'

selenium_browser/selenium_browser.py", line 62, in init
self.driver = webdriver_class(**webdriver_kwargs)
TypeError: init() got an unexpected keyword argument 'firefox_options'

how can i solve this error?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.