Metadata-Version: 2.2
Name: vine_wayback
Version: 0.0.6
Summary: Fetch Vines from the Wayback Machine
License: The MIT License (MIT)
        
        Copyright (c) Ed Summers
        
        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.
        
        
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.32.3
Requires-Dist: beautifulsoup4>=4.12.3
Requires-Dist: wayback>=0.4.5

# vine_wayback

[![Tests](https://github.com/edsu/vine_wayback/actions/workflows/test.yml/badge.svg)](https://github.com/edsu/vine_wayback/actions/workflows/test.yml)

*vine_wayback* tries to retrieve a Vine video and its metadata from the Wayback Machine. If the Vine can be found in the Wayback Machine it will be written to disk as an MP4, JSON and standalone HTML file which you can use to view the Vine.

## Install

```shell
pip install vine_wayback
```

## Run

When you install *vine_wayback* you should get the `vine_wayback` command line utility installed as well:

```
vine_wayback https://vine.co/v/iuKJ7JjF2Jt
💾 saved https://vine.co/v/iuKJ7JjF2Jt to /Users/edsu/Projects/vine-wayback/iuKJ7JjF2Jt
```

This will create a directory like:

```
iuKJ7JjF2Jt
├── index.html
├── iuKJ7JjF2Jt.json
└── iuKJ7JjF2Jt.mp4
```

## Import

Maybe you want to make this part of a script that downloads a bunch of vines. You can use the `download()` function to download the Vine where you want to:

```python
import vine_wayback

vine_wayback.download("https://vine.co/v/iuKJ7JjF2Jt", output_dir="my/dir", quiet=True)
```

Or you can work with the metadata and video directly:

```python
import vine_wayback

vine = vine_wayback.vine("https://vine.co/v/iuKJ7JjF2Jt")

# print some of the metadata
print(vine['twitter:title'])

# save the video
open('media.mp4', 'wb').write(vine['video_raw'])
```
