# Mendia File Scraper
## About
This is a client for [mendia](https://crates.io/crates/mendia).
It indexes local media (currently limited to movies), stores the findings in a local database and publishes new additions to the server running mendia.
## Installation:
```console
sudo apt update
sudo apt install libmediainfo0v5
pip install mendiafilescraper
```
> Note: This package needs the mediainfo library.
>
> Ubuntu/Debian: 'libmediainfo0v5'
>
> Arch: 'libmediainfo'
## Usage:
```--setup```:
> Asks for
> - Username
> - Password
> - Media folders
> - Server address (e.g `wss://hostname/ws/`, depending on the `mendia` server)
>
> and stores everything in a config file in the home directory
>
> `~/.mendiafilescraper/config.txt`
```--scan```:
> Searches all given media folders for new additions and adds them to the database.
```--publish```:
> Sends new additions to the configured `mendia` server. Use only with `--scan`
## Example:
### Settings
```console
mendia-scraper --setup
```
***Add media paths, specify the server address and put in your username and password.***
> Note: Ask the admin of your target `mendia` server to create a username/password for you.
### First scan
The initial scan populates the local database.
`--publish` should not be used for the first scan, otherwise this might flood the server.
```console
mendia-scraper --scan
```
> Warning: ***Make sure that the initial scan worked before proceeding.***
### Real scan
After the first scan we can add `--publish`, from now on new movies will be sent to `mendia`.
```console
mendia-scraper --scan --publish
```
## Cronjob
It makes sense to add the scan command to your crontab for automatic scans.
```console
crontab -e
```
For a daily scan add
```console
@daily mendia-scraper --scan --publish
```
## Problems:
### I have a new movie but mendia did not inform about it
It is possible to delete movies from the local database and to retry scanning the movie.
> Note: It is easier to use a gui application with sqlite support, but on typical NAS systems there is no gui.
```console
sudo apt install sqlite3
cd ~/.MendiaFileScraper
sqlite3 database.db
```
Let's say we want to remove the movie "Captive State".
In the sqlite3 shell:
```sql
SELECT title, hash FROM movies WHERE instr(title, 'Captive') > 0;
```
If you do not see any result, play with the search parameters until you found it.
Let's say our result is:
```
Captive State|a67edf9ee879a7562c17092b97dfe672
```
The second value is the hash value that was computed based on the movie file.
To delete the entry with the has "a67edf9ee879a7562c17092b97dfe672" we do:
```sql
DELETE FROM movies WHERE hash="a67edf9ee879a7562c17092b97dfe672";
```
`CTRL+D` to exit from the sqlite3 shell.
Voila, the movie was removed and you can retry scanning with
```console
mendia-scraper --scan --publish
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/derfreak/MediaScrapper",
"name": "mendiafilescraper",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "",
"keywords": "mendia,movies,collection",
"author": "Lukas Riedersberger",
"author_email": "lukas.riedersberger@posteo.de",
"download_url": "https://files.pythonhosted.org/packages/94/2e/2f4a25533e5aa8367a826df97893bad2461efb646dbe80c3bfedb3801522/mendiafilescraper-3.1.1.tar.gz",
"platform": null,
"description": "# Mendia File Scraper\n\n## About\n\nThis is a client for [mendia](https://crates.io/crates/mendia).\nIt indexes local media (currently limited to movies), stores the findings in a local database and publishes new additions to the server running mendia.\n\n## Installation:\n\n```console\nsudo apt update\nsudo apt install libmediainfo0v5\npip install mendiafilescraper\n```\n\n> Note: This package needs the mediainfo library.\n>\n> Ubuntu/Debian: 'libmediainfo0v5'\n>\n> Arch: 'libmediainfo'\n\n## Usage:\n\n```--setup```:\n> Asks for\n> - Username\n> - Password\n> - Media folders\n> - Server address (e.g `wss://hostname/ws/`, depending on the `mendia` server)\n>\n> and stores everything in a config file in the home directory\n>\n> `~/.mendiafilescraper/config.txt`\n\n```--scan```:\n> Searches all given media folders for new additions and adds them to the database.\n\n```--publish```:\n> Sends new additions to the configured `mendia` server. Use only with `--scan`\n\n## Example:\n### Settings\n\n```console\nmendia-scraper --setup\n```\n\n***Add media paths, specify the server address and put in your username and password.***\n\n> Note: Ask the admin of your target `mendia` server to create a username/password for you.\n\n### First scan\nThe initial scan populates the local database.\n`--publish` should not be used for the first scan, otherwise this might flood the server.\n\n```console\nmendia-scraper --scan\n```\n\n> Warning: ***Make sure that the initial scan worked before proceeding.***\n\n### Real scan\n\nAfter the first scan we can add `--publish`, from now on new movies will be sent to `mendia`.\n\n```console\nmendia-scraper --scan --publish\n```\n\n## Cronjob\n\nIt makes sense to add the scan command to your crontab for automatic scans.\n\n```console\ncrontab -e\n```\n\nFor a daily scan add\n\n```console\n@daily mendia-scraper --scan --publish\n```\n\n## Problems:\n\n### I have a new movie but mendia did not inform about it\n\nIt is possible to delete movies from the local database and to retry scanning the movie.\n\n> Note: It is easier to use a gui application with sqlite support, but on typical NAS systems there is no gui.\n\n```console\nsudo apt install sqlite3\ncd ~/.MendiaFileScraper\nsqlite3 database.db\n```\n\nLet's say we want to remove the movie \"Captive State\".\n\nIn the sqlite3 shell:\n```sql\nSELECT title, hash FROM movies WHERE instr(title, 'Captive') > 0;\n```\nIf you do not see any result, play with the search parameters until you found it.\n\nLet's say our result is:\n```\nCaptive State|a67edf9ee879a7562c17092b97dfe672\n```\n\nThe second value is the hash value that was computed based on the movie file.\nTo delete the entry with the has \"a67edf9ee879a7562c17092b97dfe672\" we do:\n```sql\nDELETE FROM movies WHERE hash=\"a67edf9ee879a7562c17092b97dfe672\";\n```\n\n`CTRL+D` to exit from the sqlite3 shell.\n\nVoila, the movie was removed and you can retry scanning with\n\n```console\nmendia-scraper --scan --publish\n```\n",
"bugtrack_url": null,
"license": "LICENSE",
"summary": "File scrapper for clients to sync with a mendia rust application running on a server.",
"version": "3.1.1",
"split_keywords": [
"mendia",
"movies",
"collection"
],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "fa14b7d3fc946f2e8913b5816480bbf9",
"sha256": "09aab1ecc8983e5ab283ae8e8a809d431ba05c204c1d4f4ee374fd9f95b5afa7"
},
"downloads": -1,
"filename": "mendiafilescraper-3.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fa14b7d3fc946f2e8913b5816480bbf9",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 13142,
"upload_time": "2022-12-30T14:56:53",
"upload_time_iso_8601": "2022-12-30T14:56:53.703089Z",
"url": "https://files.pythonhosted.org/packages/26/ad/500cd0d77a48fea2011fd11cd463035a1098b2eb8e2d6cea658051108c04/mendiafilescraper-3.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "10c57bbafe9564cfb97f7658b51ae1d4",
"sha256": "be8f7fb3f2eec3fdaf6e71cfb6d5c14e70636c246bf2b30b8efd43cb2d0dea1f"
},
"downloads": -1,
"filename": "mendiafilescraper-3.1.1.tar.gz",
"has_sig": false,
"md5_digest": "10c57bbafe9564cfb97f7658b51ae1d4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 12344,
"upload_time": "2022-12-30T14:56:55",
"upload_time_iso_8601": "2022-12-30T14:56:55.088994Z",
"url": "https://files.pythonhosted.org/packages/94/2e/2f4a25533e5aa8367a826df97893bad2461efb646dbe80c3bfedb3801522/mendiafilescraper-3.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-12-30 14:56:55",
"github": false,
"gitlab": true,
"bitbucket": false,
"gitlab_user": "derfreak",
"gitlab_project": "MediaScrapper",
"lcname": "mendiafilescraper"
}