semvec/pypi-packages huggingface dataset:
youtubesnoop 0.1.6
YouTube video/music downloader with metadata tagging and cover art
License: MIT
Requires Python: >=3.8
Keywords: downloader, flac, metadata, music, musicbrainz, youtube

# YoutubeSnoop

[![](https://img.shields.io/pypi/v/youtubesnoop.svg)](https://pypi.org/pypi/youtubesnoop/)

A Youtube downloader of the highest quality

---

## Installation

You can install it via pip:

```bash
$ pip install youtubesnoop
```

---

## Prerequisites

* [ffmpeg](https://ffmpeg.org/) must be installed and available in your PATH.

---

## Usage

A simple command-line tool that downloads Youtube videos in the highest quality available.

Just provide a Youtube URL:

```bash
$ youtubesnoop https://www.youtube.com/watch?v=dQw4w9WgXcQ
```

It will download single tracks to this format:

```plaintext
{title}.flac
```

### Downloading Album Playlists

Provide a playlist URL and it will create a folder for the artist and nest it with the year and album title:

```plaintext
{artist}/{year} - {albumTitle}
```

This fits my personal need to download albums from Youtube playlists.

Each track will be named like this:

```plaintext
{tracknumber}. {title}.flac
```

It will try to infer the metadata from the playlist and set it in the downloaded files. Otherwise it will prompt you for it. It uses the [mutagen](https://mutagen.readthedocs.io/en/latest/) library to set the metadata with the help of [musicbrainz](https://musicbrainz.org/) to fix any mistakes. It uses [musicbrainzngs](https://pypi.org/project/musicbrainzngs/) to download cover art as `Cover.jpg` or `Cover.png` and place it in the folder and added to the metadata of each track.

### Videos

It downloads as `flac` files per default but with the `--video` flag it will download the video as `mp4` instead.


---

## 403 Forbidden Errors

Youtube constantly changes their API. The solution is likely to upgrade the `yt-dlp` dependency that this package uses under the hood.

Run:

```bash
$ pip install --upgrade youtubesnoop
```

Or:

```bash
$ pipx upgrade yt-dlp
```

---

## Windows Note

It has been tested on Windows (Powershell) and MacOS. 

For Powershell, remember to wrap the URL in quotes to avoid issues with special characters such as `&` being interpreted.

On Windows, don't use Git Bash since `prompt_toolkit` has issues with it ANSI escape codes etc.
bleached 1.0.1
Validate HTML against a small subset (for example generated by bleach)
License: MIT
Requires Python: <4.0,>=3.5
Keywords: html, html-sanitation, sanitizer, bleach

# bleached

This is a small HTML checker. It can validate that HTML code is safe.

It does not aim to support the entire HTML spec, rather it focuses on checking HTML that has been run through a sanitizer (such as [nh3](https://github.com/messense/nh3) or the older [bleach](https://github.com/mozilla/bleach)).

## How to use?

```
$ pip install bleached
$ python3
>>> import bleached
>>> bleached.is_html_bleached('<p>Hello world</p>')
True
>>> bleached.is_html_bleached('<script>alert("Hello world");</script>')
False
>>> bleached.check_html('<p>Hello world</p>')
>>> bleached.check_html('<script>alert("Hello world");</script>')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
bleached.UnsafeInput: Line 1 character 8 (input index 7): Found forbidden opening tag 'script'
```

## Why use this?

[nh3](https://github.com/messense/nh3) is a great library for sanitizing untrusted HTML. You should use it instead of this where possible.

However, it offers no way to check that a piece of HTML has been sanitized. Running the HTML through nh3 again will only work if you have the exact same version, as nh3 makes no guarantee of stability of their input. This is where bleached is useful.

## Warnings

* No validation of attribute valuess is performed. If you choose to allow an attribute, it is up to you to validate the values.
* This accepts a much smaller subset of HTML than web browsers. Be ready for false negatives if you use this to validate HTML documents.