Metadata-Version: 2.1
Name: pychute
Version: 0.0.5
Summary: A library that helps downloading videos from bitchute.com
Home-page: http://github.com/paichiwo/pychute
Author: Lukasz Zerucha
Author-email: Lukasz Zerucha <lzerucha@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Lukasz Zerucha
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: Homepage, https://github.com/paichiwo/pychute
Project-URL: Issues, https://github.com/paichiwo/pychute/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: lxml
Requires-Dist: selenium
Requires-Dist: beautifulsoup4

# pychute


### A library that helps download videos from BitChute website


---

### Installation:
`pip install pychute`

### How to use:
```python
from pychute import PyChute

url = "bitchute url"

pc = PyChute(url=url)
pc.download()
```
---

### Additional features:

#### Progress callback
If you need to get progress like percentage or download speed, you can create a function 
and pass as a parameter in the download method.

```python
import time
from pychute import PyChute

start_time = time.time()

def show_progress(count, block_size, total_size):
    
    # progress percentage
    progress = min(1.0, float(count * block_size) / total_size)
    print("Progress:", progress)

    # download speed
    elapsed_time = time.time() - start_time
    if elapsed_time > 0:
        speed = (count * block_size) / (1024 * elapsed_time)  # speed in KB/s
        print(f'Download speed: {speed:.2f} KB/s')


url = "bitchute url"

pc = PyChute(url=url)
pc.download(on_progress_callback=show_progress)
```
___

#### Filename
You can pass filename as a parameter in the form of a string to specify download location.
Using download method without the `filename` parameter will save the file to where your script is located.

```python
from pychute import PyChute

url = "bitchute url"

pc = PyChute(url=url)
output_path = f"D:\\Downloads/{pc.title()}"

pc.download()
```

---

#### Other data
Apart from downloading, you can access other data about BitChute video:

```python
from pychute import PyChute

url = "bitchute url"

pc = PyChute(url=url)
output_path = f"D:\\Downloads/{pc.title()}"

# video title
print(pc.title())

# channel name
print(pc.channel())

# video publish date
print(pc.publish_date())

# video duration
print(pc.length())

# subscriptions number
print(pc.subscriptions())

# video likes
print(pc.likes())

# video views
print(pc.views())
```
