Skip to content

Commit

Permalink
fix upload and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
offish committed Nov 10, 2021
1 parent 561dc69 commit c131820
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.venv
test.py
*.log
opplast/__pycache__
dist/
*.egg-info
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,20 @@ Open Firefox, and go to `about:profiles`. Click "Create a New profile" and name
It's highly recommended that you clear your standard upload settings on YouTube.

```python
Upload(root_profile_directory: str, executable_path: str = "geckodriver", timeout: int = 3, headless: bool = True, debug: bool = True) -> None
Upload(root_profile_directory: str, executable_path: str = "geckodriver", timeout: int = 3, headless: bool = True, debug: bool = True, options: FirefoxOptions = webdriver.FirefoxOptions()) -> None
```
`root_profile_directory: str` - path to Firefox profile where you're logged into YouTube.

`executable_path: str` - full path to override which geckodriver binary to use for Firefox 47.0.1 and greater, which defaults to picking up the binary from the system path. Example: `r"C:/Users/USERNAME/Desktop/geckodriver"` (if geckodriver.exe is located in Desktop folder) Default: `geckodriver`.

`timeout: int` - seconds Selenium should wait, when getting pages and inserting data. Default: `3`.

`headless: bool` - whether or not you want to see the browser GUI. Default: `True` (hidden).
`headless: bool` - whether or not you want to see the browser GUI. **Will override headless option if specified in `options`.** Default: `True` (hidden).

`debug: bool` - whether or not you want to see the debug info. Default: `True` (shown).

`options: FirefoxOptions` - optional options for webdriver. Use `headless` if you want to hide browser.


## Usage
```python
Expand All @@ -63,6 +65,8 @@ was_uploaded, video_id = upload.upload(
description="My YouTube Description",
thumbnail=r"C:/path/to/thumbnail.jpg",
tags=["these", "are", "my", "tags"],
only_upload=False # If True will not set title, description or anything else.
# Might be useful if you want to do it manually or by using the YouTube API.
)

if was_uploaded:
Expand Down
2 changes: 1 addition & 1 deletion opplast/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__name__ = "opplast"
__version__ = "1.0.11"
__version__ = "1.0.12"

from .exceptions import *
from .constants import *
Expand Down
2 changes: 1 addition & 1 deletion opplast/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ERROR_CONTAINER = '//*[@id="error-message"]'
STATUS_CONTAINER = "/html/body/ytcp-uploads-dialog/tp-yt-paper-dialog/div/ytcp-animatable[2]/div/div[1]/ytcp-video-upload-progress/span"
VIDEO_URL_CONTAINER = "//span[@class='video-url-fadeable style-scope ytcp-video-info']"
DESCRIPTION_CONTAINER = "/html/body/ytcp-uploads-dialog/tp-yt-paper-dialog/div/ytcp-animatable[1]/ytcp-video-metadata-editor/div/ytcp-video-metadata-editor-basics/div[2]/ytcp-mention-textbox/ytcp-form-input-container/div[1]/div[2]/ytcp-mention-input"
DESCRIPTION_CONTAINER = "/html/body/ytcp-uploads-dialog/tp-yt-paper-dialog/div/ytcp-animatable[1]/ytcp-video-metadata-editor/div/ytcp-video-metadata-editor-basics/div[2]/ytcp-social-suggestions-textbox/ytcp-form-input-container/div[1]/div[2]/ytcp-mention-input"
MORE_OPTIONS_CONTAINER = "/html/body/ytcp-uploads-dialog/tp-yt-paper-dialog/div/ytcp-animatable[1]/ytcp-video-metadata-editor/div/div/ytcp-button"

# COUNTERS
Expand Down

0 comments on commit c131820

Please sign in to comment.