generated from pavel.muhortov/template-bash
	Compare commits
	
		
			17 Commits
		
	
	
		
			c700997ed3
			...
			fa636bf603
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| fa636bf603 | |||
| c3b2d897c7 | |||
| cb03bae49b | |||
| ba72ef9407 | |||
| bff385d0a5 | |||
| 17b180bc4f | |||
| 7a12aed45b | |||
| d793e47e6c | |||
| c575e844f2 | |||
| aea4a5ba52 | |||
| 2079c7f951 | |||
| 8d44f2a4f3 | |||
| 094a3802ec | |||
| 0af51a29b6 | |||
| 699492f77f | |||
| db76bb8e0b | |||
| 3e938f20cc | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -22,6 +22,7 @@ dist/
 | 
				
			||||||
downloads/
 | 
					downloads/
 | 
				
			||||||
test/
 | 
					test/
 | 
				
			||||||
tmp/
 | 
					tmp/
 | 
				
			||||||
 | 
					temp/
 | 
				
			||||||
var/
 | 
					var/
 | 
				
			||||||
*.log
 | 
					*.log
 | 
				
			||||||
*.list
 | 
					*.list
 | 
				
			||||||
							
								
								
									
										40
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										40
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -30,6 +30,46 @@
 | 
				
			||||||
            ],
 | 
					            ],
 | 
				
			||||||
            "console": "integratedTerminal",
 | 
					            "console": "integratedTerminal",
 | 
				
			||||||
            "justMyCode": true
 | 
					            "justMyCode": true
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "name": "Python: cctv-scheduler -c -w -3",
 | 
				
			||||||
 | 
					            "type": "python",
 | 
				
			||||||
 | 
					            "request": "launch",
 | 
				
			||||||
 | 
					            "program": "${file}",
 | 
				
			||||||
 | 
					            "args": [
 | 
				
			||||||
 | 
					                "-c",
 | 
				
			||||||
 | 
					                "-w",
 | 
				
			||||||
 | 
					                "-3"
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					            "console": "integratedTerminal",
 | 
				
			||||||
 | 
					            "justMyCode": true
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "name": "Python: cctv-scheduler -p -w -3",
 | 
				
			||||||
 | 
					            "type": "python",
 | 
				
			||||||
 | 
					            "request": "launch",
 | 
				
			||||||
 | 
					            "program": "${file}",
 | 
				
			||||||
 | 
					            "args": [
 | 
				
			||||||
 | 
					                "-p",
 | 
				
			||||||
 | 
					                "-w",
 | 
				
			||||||
 | 
					                "-3"
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					            "console": "integratedTerminal",
 | 
				
			||||||
 | 
					            "justMyCode": true
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            "name": "Python: cctv-scheduler -w -3 -c -p",
 | 
				
			||||||
 | 
					            "type": "python",
 | 
				
			||||||
 | 
					            "request": "launch",
 | 
				
			||||||
 | 
					            "program": "${file}",
 | 
				
			||||||
 | 
					            "args": [
 | 
				
			||||||
 | 
					                "-w",
 | 
				
			||||||
 | 
					                "-3",
 | 
				
			||||||
 | 
					                "-c",
 | 
				
			||||||
 | 
					                "-p"
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					            "console": "integratedTerminal",
 | 
				
			||||||
 | 
					            "justMyCode": true
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
							
								
								
									
										136
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										136
									
								
								README.md
									
									
									
									
									
								
							| 
						 | 
					@ -4,12 +4,10 @@ PTZ IP-Camera management
 | 
				
			||||||
____
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- [`cctv-scheduler.py`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#cctv-scheduler-py)
 | 
					- [`cctv-scheduler.py`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#cctv-scheduler-py)
 | 
				
			||||||
- [`converter.sh`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#converter-sh)
 | 
					 | 
				
			||||||
- [`publisher.sh`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#publisher-sh)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
____
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||

 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## `Installation`
 | 
					## `Installation`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,11 +29,6 @@ Download scripts and configs.
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/cctv-scheduler.py -O /home/user/cctv-scheduler/cctv-scheduler.py
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/cctv-scheduler.py -O /home/user/cctv-scheduler/cctv-scheduler.py
 | 
				
			||||||
wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/cctv-scheduler.conf -O /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/cctv-scheduler.conf -O /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/converter.sh -O /home/user/cctv-scheduler/converter.sh
 | 
					 | 
				
			||||||
wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/converter.conf -O /home/user/cctv-scheduler/converter.conf
 | 
					 | 
				
			||||||
wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher.sh -O /home/user/cctv-scheduler/publisher.sh
 | 
					 | 
				
			||||||
wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher.conf -O /home/user/cctv-scheduler/publisher.conf
 | 
					 | 
				
			||||||
wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher-template-page-1007.xml -O /home/user/cctv-scheduler/publisher-template-page-1007.xml
 | 
					 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### `Configuration`
 | 
					### `Configuration`
 | 
				
			||||||
| 
						 | 
					@ -44,8 +37,6 @@ Edit configs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
nano /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
					nano /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
nano /home/user/cctv-scheduler/converter.conf
 | 
					 | 
				
			||||||
nano /home/user/cctv-scheduler/publisher.conf
 | 
					 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### `Scheduler`
 | 
					### `Scheduler`
 | 
				
			||||||
| 
						 | 
					@ -59,59 +50,26 @@ crontab -e
 | 
				
			||||||
## `cctv-scheduler`.py
 | 
					## `cctv-scheduler`.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Description:**  
 | 
					**Description:**  
 | 
				
			||||||
> [Hikvision](https://git.hmp.today/pavel.muhortov/cctv-scheduler/src/branch/master/info/hikvision/manual/isapi.pdf) PTZ IP-Camera management. Media streaming.  
 | 
					> [Hikvision](https://git.hmp.today/pavel.muhortov/cctv-scheduler/src/branch/master/info/hikvision/manual/isapi.pdf) PTZ IP-Camera management. Media streaming. Images to video converting.  
 | 
				
			||||||
> Additionally:
 | 
					> Additionally:
 | 
				
			||||||
>
 | 
					>
 | 
				
			||||||
> - getting temperature from DS18B20 over SSH,
 | 
					> - getting temperature from DS18B20 over SSH,
 | 
				
			||||||
> - saving pictures to FTP.
 | 
					> - saving pictures to FTP.
 | 
				
			||||||
 | 
					> - converting picture collection to video.
 | 
				
			||||||
 | 
					> - publishing video to Telegram chat and Wordpress site.
 | 
				
			||||||
>
 | 
					>
 | 
				
			||||||
> This is only a local "proof of conept" for testing and debugging.
 | 
					> This is only a local "proof of concept" for testing and debugging.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
**Dependencies:**  
 | 
					**Dependencies:**  
 | 
				
			||||||
>
 | 
					>
 | 
				
			||||||
> - [Python 3](https://www.python.org/downloads/) (tested version 3.9.5 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					> - [Python 3](https://www.python.org/downloads/) (tested version 3.9.5 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
> - [paramiko](https://www.paramiko.org/) Python 3 module (tested version 3.1.0)
 | 
					> - [paramiko](https://www.paramiko.org/) Python 3 module (tested version 3.1.0)
 | 
				
			||||||
 | 
					> - [smbprotocol](https://github.com/jborean93/smbprotocol) Python 3 module (tested version 1.10.1)
 | 
				
			||||||
> - [ffmpeg](https://ffmpeg.org) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					> - [ffmpeg](https://ffmpeg.org) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - specified record pictures filesystem organization
 | 
				
			||||||
|  PARAMETERS | DESCRIPTION | DEFAULT|
 | 
					 | 
				
			||||||
|-------------|-------------|--------|
 | 
					 | 
				
			||||||
|**[-h]**|print help and exit||
 | 
					 | 
				
			||||||
|**[-b, --broadcast]**|streaming media to destination|`None`|
 | 
					 | 
				
			||||||
|**[-s, --sequences]**|run sequences from config file|`None`|
 | 
					 | 
				
			||||||
|**[--config]**|custom configuration file path|`./cctv-scheduler.conf`|
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Example usage in terminal with make the script executable:  
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```bash
 | 
					 | 
				
			||||||
chmod u+x ./cctv-scheduler.py
 | 
					 | 
				
			||||||
./cctv-scheduler.py -s --config /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Example usage with cron:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```bash
 | 
					 | 
				
			||||||
# crontab -e
 | 
					 | 
				
			||||||
*  *  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -b
 | 
					 | 
				
			||||||
0  *  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -s
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
____
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## `converter`.sh
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Description:**  
 | 
					 | 
				
			||||||
> JPEG to MP4 converter.
 | 
					 | 
				
			||||||
>
 | 
					 | 
				
			||||||
> This is only a local "proof of conept" for testing and debugging.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Dependencies:**  
 | 
					 | 
				
			||||||
>
 | 
					 | 
				
			||||||
> - [bash](https://www.gnu.org/software/bash/) (tested version 5.1.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					 | 
				
			||||||
> - [ffmpeg](https://ffmpeg.org/download.html) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					 | 
				
			||||||
> - filesystem organization:
 | 
					 | 
				
			||||||
>
 | 
					>
 | 
				
			||||||
>```bash
 | 
					>```bash
 | 
				
			||||||
> # filesystem organisation example
 | 
					> # record pictures filesystem organization example
 | 
				
			||||||
>/root/
 | 
					>/root/
 | 
				
			||||||
>      /2022/
 | 
					>      /2022/
 | 
				
			||||||
>           /12/
 | 
					>           /12/
 | 
				
			||||||
| 
						 | 
					@ -130,70 +88,34 @@ ____
 | 
				
			||||||
>                    /image-02_2023.01.03_time.jpeg
 | 
					>                    /image-02_2023.01.03_time.jpeg
 | 
				
			||||||
>```
 | 
					>```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
|  POSITION | PARAMETERS   |       DESCRIPTION      |    DEFAULT    |
 | 
					|  PARAMETERS | DESCRIPTION | DEFAULT|
 | 
				
			||||||
|-----------|--------------|------------------------|---------------|
 | 
					|-------------|-------------|--------|
 | 
				
			||||||
|     1     |    **[qn]**    |execution without pauses||
 | 
					|**[-h]**|print help and exit||
 | 
				
			||||||
|     2     |    **[/path/to/conf]**    |path to config|     `./converter.conf`    |
 | 
					|**[-b, --broadcast]**|streaming media to destination|`None`|
 | 
				
			||||||
|     3     |    **[-d\|-w\|-m\|-y]**    |periods: '' - today \| '-d' - yesterday \| '-w' - last week \| '-m' - last month \| '-y' - last year|`''`|
 | 
					|**[-s, --sequences]**|run sequences from config file|`None`|
 | 
				
			||||||
 | 
					|**[--config]**|custom configuration file path|`./cctv-scheduler.conf`|
 | 
				
			||||||
 | 
					|**[-c, --converter]**|convert JPEG collection to MP4|`None`|
 | 
				
			||||||
 | 
					|**[-p, --publisher]**|publish content from templates|`None`|
 | 
				
			||||||
 | 
					|**[-d, --day]**|day in amount of days from today, for which the publication or conversion is made|`0`|
 | 
				
			||||||
 | 
					|**[-w, --week]**|week in amount of weeks from today, for which the publication or conversion is made|`0`|
 | 
				
			||||||
 | 
					|**[-m, --month]**|month in amount of months from today, for which the publication or conversion is made|`0`|
 | 
				
			||||||
 | 
					|**[-y, --year]**|year in amount of years from today, for which the publication or conversion is made|`0`|
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Example usage in terminal with bash for today's MP4 making:
 | 
					Example usage in terminal with make the script executable:  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
bash ./converter.sh - ./converter.conf
 | 
					chmod u+x ./cctv-scheduler.py
 | 
				
			||||||
 | 
					./cctv-scheduler.py -s --config /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Example usage with cron:
 | 
					Example usage with cron:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```bash
 | 
					```bash
 | 
				
			||||||
# crontab -e
 | 
					# crontab -e
 | 
				
			||||||
1  0  *  *  * bash /home/user/cctv-scheduler/converter.sh qn - -d
 | 
					*  *  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -b
 | 
				
			||||||
7  0  *  *  1 bash /home/user/cctv-scheduler/converter.sh qn - -w
 | 
					0  *  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -s
 | 
				
			||||||
30 0  1  *  * bash /home/user/cctv-scheduler/converter.sh qn - -m
 | 
					1  0  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -d -1 -c -p
 | 
				
			||||||
36 0  1  1  * bash /home/user/cctv-scheduler/converter.sh qn - -y
 | 
					7  0  *  *  1 /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -w -1 -c -p
 | 
				
			||||||
```
 | 
					30 0  1  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -m -1 -c -p
 | 
				
			||||||
 | 
					36 0  1  1  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -y -1 -c -p
 | 
				
			||||||
____
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## `publisher`.sh
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Description:**
 | 
					 | 
				
			||||||
> Uploading MP4 to [Wordpress](https://wordpress.com/) and [Telegram](https://web.telegram.org/).  
 | 
					 | 
				
			||||||
> Additionally:
 | 
					 | 
				
			||||||
>
 | 
					 | 
				
			||||||
> - editing [Wordpress](https://codex.wordpress.org/XML-RPC_WordPress_API) page from template
 | 
					 | 
				
			||||||
> - recompressing video if size [over 50MB](https://core.telegram.org/bots/api#sendvideo)
 | 
					 | 
				
			||||||
>
 | 
					 | 
				
			||||||
> This is only a local "proof of conept" for testing and debugging.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
**Dependencies:**  
 | 
					 | 
				
			||||||
>
 | 
					 | 
				
			||||||
> - [bash](https://www.gnu.org/software/bash/) (tested version 5.1.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					 | 
				
			||||||
> - [curl](https://curl.se/download.html) (tested version 7.74 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					 | 
				
			||||||
> - [ffmpeg](https://ffmpeg.org/download.html) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					 | 
				
			||||||
> - [libxml2-utils](https://gitlab.gnome.org/GNOME/libxml2) (tested version 2.9.10 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					 | 
				
			||||||
> - [jq](https://stedolan.github.io/jq/download/) (tested version 1.6 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
					 | 
				
			||||||
>
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
|  POSITION | PARAMETERS   |       DESCRIPTION      |    DEFAULT    |
 | 
					 | 
				
			||||||
|-----------|--------------|------------------------|---------------|
 | 
					 | 
				
			||||||
|     1     |    **[qn]**    |execution without pauses||
 | 
					 | 
				
			||||||
|     2     |    **[/path/to/conf]**    |path to config|     `./publisher.conf`   |
 | 
					 | 
				
			||||||
|     3     |    **[-d\|-w\|-m\|-y]**    |periods: '' - 0 day \| '-d' - -X day \| '-w' - -X week \| '-m' - -X month \| '-y' - -X year|`''`|
 | 
					 | 
				
			||||||
|     4     |    **[1\|2\|3..XXX]**    |multiplier for period: '' - 1 day\|week\|month\|year|`1`|
 | 
					 | 
				
			||||||
|     5     |    **[--onlytg\|--onlywp]**    |'--onlytg' - only publish to Telegram \|'--onlywp' - only publish to Wordpress||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Example usage in terminal with bash for publish to Telegram today's MP4:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```bash
 | 
					 | 
				
			||||||
bash ./publisher.sh - ./publisher.conf - - - - --onlytg
 | 
					 | 
				
			||||||
```
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Example usage with cron:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
```bash
 | 
					 | 
				
			||||||
# crontab -e
 | 
					 | 
				
			||||||
1  1  *  *  * bash /home/user/cctv-scheduler/publisher.sh qn - -d
 | 
					 | 
				
			||||||
7  1  *  *  1 bash /home/user/cctv-scheduler/publisher.sh qn - -w
 | 
					 | 
				
			||||||
30 1  1  *  * bash /home/user/cctv-scheduler/publisher.sh qn - -m
 | 
					 | 
				
			||||||
36 1  1  1  * bash /home/user/cctv-scheduler/publisher.sh qn - -y
 | 
					 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										199
									
								
								archive/0.3/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										199
									
								
								archive/0.3/README.md
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,199 @@
 | 
				
			||||||
 | 
					# cctv-scheduler
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					PTZ IP-Camera management
 | 
				
			||||||
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- [`cctv-scheduler.py`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#cctv-scheduler-py)
 | 
				
			||||||
 | 
					- [`converter.sh`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#converter-sh)
 | 
				
			||||||
 | 
					- [`publisher.sh`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#publisher-sh)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `Installation`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `Requirements`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Cameras settings:
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - Configuration -> System -> Security -> Authentication -> RTSP Authentication: digest/basic
 | 
				
			||||||
 | 
					> - Configuration -> System -> Security -> Authentication -> WEB Authentication: digest/basic
 | 
				
			||||||
 | 
					> - Configuration -> Network -> Advanced Settings -> Integration Protocol -> Enable Hikvision-CGI: Enabled
 | 
				
			||||||
 | 
					> - Configuration -> Network -> Advanced Settings -> Integration Protocol -> Hikvision-CGI Authentication: digest/basic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Look at the description of dependencies and install the necessary.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `Downloading`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Download scripts and configs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/cctv-scheduler.py -O /home/user/cctv-scheduler/cctv-scheduler.py
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/cctv-scheduler.conf -O /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/converter.sh -O /home/user/cctv-scheduler/converter.sh
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/converter.conf -O /home/user/cctv-scheduler/converter.conf
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher.sh -O /home/user/cctv-scheduler/publisher.sh
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher.conf -O /home/user/cctv-scheduler/publisher.conf
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher-template-page-1007.xml -O /home/user/cctv-scheduler/publisher-template-page-1007.xml
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `Configuration`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Edit configs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					nano /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
 | 
					nano /home/user/cctv-scheduler/converter.conf
 | 
				
			||||||
 | 
					nano /home/user/cctv-scheduler/publisher.conf
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `Scheduler`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Look at examples and edit scheduler tasks:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					crontab -e
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `cctv-scheduler`.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Description:**  
 | 
				
			||||||
 | 
					> [Hikvision](https://git.hmp.today/pavel.muhortov/cctv-scheduler/src/branch/master/info/hikvision/manual/isapi.pdf) PTZ IP-Camera management. Media streaming.  
 | 
				
			||||||
 | 
					> Additionally:
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - getting temperature from DS18B20 over SSH,
 | 
				
			||||||
 | 
					> - saving pictures to FTP.
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> This is only a local "proof of conept" for testing and debugging.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Dependencies:**  
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - [Python 3](https://www.python.org/downloads/) (tested version 3.9.5 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [paramiko](https://www.paramiko.org/) Python 3 module (tested version 3.1.0)
 | 
				
			||||||
 | 
					> - [ffmpeg](https://ffmpeg.org) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					|  PARAMETERS | DESCRIPTION | DEFAULT|
 | 
				
			||||||
 | 
					|-------------|-------------|--------|
 | 
				
			||||||
 | 
					|**[-h]**|print help and exit||
 | 
				
			||||||
 | 
					|**[-b, --broadcast]**|streaming media to destination|`None`|
 | 
				
			||||||
 | 
					|**[-s, --sequences]**|run sequences from config file|`None`|
 | 
				
			||||||
 | 
					|**[--config]**|custom configuration file path|`./cctv-scheduler.conf`|
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage in terminal with make the script executable:  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					chmod u+x ./cctv-scheduler.py
 | 
				
			||||||
 | 
					./cctv-scheduler.py -s --config /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage with cron:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					# crontab -e
 | 
				
			||||||
 | 
					*  *  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -b
 | 
				
			||||||
 | 
					0  *  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -s
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `converter`.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Description:**  
 | 
				
			||||||
 | 
					> JPEG to MP4 converter.
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> This is only a local "proof of conept" for testing and debugging.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Dependencies:**  
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - [bash](https://www.gnu.org/software/bash/) (tested version 5.1.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [ffmpeg](https://ffmpeg.org/download.html) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - filesystem organization:
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					>```bash
 | 
				
			||||||
 | 
					> # filesystem organisation example
 | 
				
			||||||
 | 
					>/root/
 | 
				
			||||||
 | 
					>      /2022/
 | 
				
			||||||
 | 
					>           /12/
 | 
				
			||||||
 | 
					>              /52/
 | 
				
			||||||
 | 
					>                 /31/
 | 
				
			||||||
 | 
					>                    /image-01_2022.12.31_time.jpeg
 | 
				
			||||||
 | 
					>                    /image-02_2022.12.31_time.jpeg
 | 
				
			||||||
 | 
					>      /2023/
 | 
				
			||||||
 | 
					>           /01/
 | 
				
			||||||
 | 
					>              /01/
 | 
				
			||||||
 | 
					>                 /02/
 | 
				
			||||||
 | 
					>                    /image-01_2023.01.02_time.jpeg
 | 
				
			||||||
 | 
					>                    /image-02_2023.01.02_time.jpeg
 | 
				
			||||||
 | 
					>                 /03/
 | 
				
			||||||
 | 
					>                    /image-01_2023.01.03_time.jpeg
 | 
				
			||||||
 | 
					>                    /image-02_2023.01.03_time.jpeg
 | 
				
			||||||
 | 
					>```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					|  POSITION | PARAMETERS   |       DESCRIPTION      |    DEFAULT    |
 | 
				
			||||||
 | 
					|-----------|--------------|------------------------|---------------|
 | 
				
			||||||
 | 
					|     1     |    **[qn]**    |execution without pauses||
 | 
				
			||||||
 | 
					|     2     |    **[/path/to/conf]**    |path to config|     `./converter.conf`    |
 | 
				
			||||||
 | 
					|     3     |    **[-d\|-w\|-m\|-y]**    |periods: '' - today \| '-d' - yesterday \| '-w' - last week \| '-m' - last month \| '-y' - last year|`''`|
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage in terminal with bash for today's MP4 making:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					bash ./converter.sh - ./converter.conf
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage with cron:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					# crontab -e
 | 
				
			||||||
 | 
					1  0  *  *  * bash /home/user/cctv-scheduler/converter.sh qn - -d
 | 
				
			||||||
 | 
					7  0  *  *  1 bash /home/user/cctv-scheduler/converter.sh qn - -w
 | 
				
			||||||
 | 
					30 0  1  *  * bash /home/user/cctv-scheduler/converter.sh qn - -m
 | 
				
			||||||
 | 
					36 0  1  1  * bash /home/user/cctv-scheduler/converter.sh qn - -y
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `publisher`.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Description:**
 | 
				
			||||||
 | 
					> Uploading MP4 to [Wordpress](https://wordpress.com/) and [Telegram](https://web.telegram.org/).  
 | 
				
			||||||
 | 
					> Additionally:
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - editing [Wordpress](https://codex.wordpress.org/XML-RPC_WordPress_API) page from template
 | 
				
			||||||
 | 
					> - recompressing video if size [over 50MB](https://core.telegram.org/bots/api#sendvideo)
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> This is only a local "proof of conept" for testing and debugging.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Dependencies:**  
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - [bash](https://www.gnu.org/software/bash/) (tested version 5.1.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [curl](https://curl.se/download.html) (tested version 7.74 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [ffmpeg](https://ffmpeg.org/download.html) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [libxml2-utils](https://gitlab.gnome.org/GNOME/libxml2) (tested version 2.9.10 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [jq](https://stedolan.github.io/jq/download/) (tested version 1.6 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					|  POSITION | PARAMETERS   |       DESCRIPTION      |    DEFAULT    |
 | 
				
			||||||
 | 
					|-----------|--------------|------------------------|---------------|
 | 
				
			||||||
 | 
					|     1     |    **[qn]**    |execution without pauses||
 | 
				
			||||||
 | 
					|     2     |    **[/path/to/conf]**    |path to config|     `./publisher.conf`   |
 | 
				
			||||||
 | 
					|     3     |    **[-d\|-w\|-m\|-y]**    |periods: '' - 0 day \| '-d' - -X day \| '-w' - -X week \| '-m' - -X month \| '-y' - -X year|`''`|
 | 
				
			||||||
 | 
					|     4     |    **[1\|2\|3..XXX]**    |multiplier for period: '' - 1 day\|week\|month\|year|`1`|
 | 
				
			||||||
 | 
					|     5     |    **[--onlytg\|--onlywp]**    |'--onlytg' - only publish to Telegram \|'--onlywp' - only publish to Wordpress||
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage in terminal with bash for publish to Telegram today's MP4:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					bash ./publisher.sh - ./publisher.conf - - - - --onlytg
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage with cron:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					# crontab -e
 | 
				
			||||||
 | 
					1  1  *  *  * bash /home/user/cctv-scheduler/publisher.sh qn - -d
 | 
				
			||||||
 | 
					7  1  *  *  1 bash /home/user/cctv-scheduler/publisher.sh qn - -w
 | 
				
			||||||
 | 
					30 1  1  *  * bash /home/user/cctv-scheduler/publisher.sh qn - -m
 | 
				
			||||||
 | 
					36 1  1  1  * bash /home/user/cctv-scheduler/publisher.sh qn - -y
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
							
								
								
									
										112
									
								
								archive/0.3/cctv-scheduler.conf
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										112
									
								
								archive/0.3/cctv-scheduler.conf
									
									
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,112 @@
 | 
				
			||||||
 | 
					[common]
 | 
				
			||||||
 | 
					# By default, a temporary files directory is created in the same path where the script is located.
 | 
				
			||||||
 | 
					# If you need change it, uncomment the parameter and set the path you want.
 | 
				
			||||||
 | 
					#temp_path = /tmp/cctv-scheduler
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# By default, logs use the same directory where the script is located.
 | 
				
			||||||
 | 
					# If you need change it, uncomment the parameter and set the path you want.
 | 
				
			||||||
 | 
					#log_root = /var/log/cctv-scheduler
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# The default log level is "INFO".
 | 
				
			||||||
 | 
					# If you get errors or want to change the logging level, uncomment the parameter and set the level you want:
 | 
				
			||||||
 | 
					#   DEBUG, INFO, WARNING, ERROR, CRITICAL.
 | 
				
			||||||
 | 
					#log_level = DEBUG
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-broadcast]
 | 
				
			||||||
 | 
					# List the broadcast block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-sequences]
 | 
				
			||||||
 | 
					# List the sequence/camera block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-sensors]
 | 
				
			||||||
 | 
					# List the sensor block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					sensor.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[broadcast-config:camera.test.local]
 | 
				
			||||||
 | 
					# Broadcast parameter description block always starts with "broadcast-config:".
 | 
				
			||||||
 | 
					src = rtsp://user:pass@192.168.254.253:554/Streaming/Channels/101,http://radio.fm:8000/stream.mp3
 | 
				
			||||||
 | 
					dst = rtp://239.0.0.1:5554
 | 
				
			||||||
 | 
					# Optionality you can change video stream framerate.
 | 
				
			||||||
 | 
					#fps = 25
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Optionality you can set YouTube recommended preset:
 | 
				
			||||||
 | 
					#   240p, 360p, 480p, 720p, 1080p, 1440p, 2160p.
 | 
				
			||||||
 | 
					#preset = 1080p
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# By default ffmpeg expected in /usr/bin/ffmpeg or C:\Program Files\ffmpeg\bin\ffmpeg.exe.
 | 
				
			||||||
 | 
					# If you need change it, uncomment the parameter and set the path you want.
 | 
				
			||||||
 | 
					#ffpath = /usr/bin/ffmpeg
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# If you get program freezes because your network unstable, uncomment the parameter.
 | 
				
			||||||
 | 
					#watchdog = true
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# By default, watchdog waits 5 seconds before terminating the program.
 | 
				
			||||||
 | 
					# If you need change it, uncomment the parameter and set the path you want.
 | 
				
			||||||
 | 
					#watchsec = 15
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# If you use crontab or other scheduler to run, uncomment the parameter to prevent process overlap.
 | 
				
			||||||
 | 
					#onlyonce = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[sensor-config:sensor.test.local]
 | 
				
			||||||
 | 
					# Remote host's sensor parameter description block always starts with "sensor-config:".
 | 
				
			||||||
 | 
					hostname = 192.168.254.252
 | 
				
			||||||
 | 
					username = user
 | 
				
			||||||
 | 
					userpass = pass
 | 
				
			||||||
 | 
					# To recognize options for polling a sensor, you must specify the type of sensor.
 | 
				
			||||||
 | 
					# Supported types:
 | 
				
			||||||
 | 
					#   ds18b20
 | 
				
			||||||
 | 
					nodetype = ds18b20
 | 
				
			||||||
 | 
					nodename = 28-1a2b3c4d5e6f
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[camera-config:camera.test.local]
 | 
				
			||||||
 | 
					# Camera parameter description block always starts with "camera-config:".
 | 
				
			||||||
 | 
					hostname = 192.168.254.253
 | 
				
			||||||
 | 
					username = user
 | 
				
			||||||
 | 
					userpass = pass
 | 
				
			||||||
 | 
					# If a record directory on a remote host is used, a username and password must be specified.
 | 
				
			||||||
 | 
					# Supported protocols:
 | 
				
			||||||
 | 
					#   FTP, SFTP.
 | 
				
			||||||
 | 
					records_root_path = ftp://192.168.254.254/Records/camera.test.local
 | 
				
			||||||
 | 
					records_root_user = user
 | 
				
			||||||
 | 
					records_root_pass = pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[camera-sequences:camera.test.local]
 | 
				
			||||||
 | 
					# Camera sequence description block always starts with "camera-sequences:".
 | 
				
			||||||
 | 
					# Place only the sequence of PTZ-actions in this block!
 | 
				
			||||||
 | 
					# Variable name can be anything. Only 'downloadjpeg' is using this for filename prefix.
 | 
				
			||||||
 | 
					# Available actions: 
 | 
				
			||||||
 | 
					#   setcamerapos, setcameramov, settextonosd, downloadjpeg, capabilities, getcamerapos,
 | 
				
			||||||
 | 
					#   setptzmovyyu, setptzmovyyd, setptzmovxxl, setptzmovxxr, setptzmovzzi, setptzmovzzo,
 | 
				
			||||||
 | 
					#   setptzpreset, setptztostop, setmovtohome, setposashome, rebootcamera.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Format (spaces are used for readability only):
 | 
				
			||||||
 | 
					#  name =       action,       x,       y,    zoom,  preset,   speed,   d(ms),    w(s),    text, notes or anything
 | 
				
			||||||
 | 
					step001 = capabilities,       -,       -,       -,       -,       -,       -,       3,        ,
 | 
				
			||||||
 | 
					step002 = getcamerapos,       -,       -,       -,       -,       -,       -,       3,        ,
 | 
				
			||||||
 | 
					step011 = setmovtohome,       -,       -,       -,       -,       -,       -,      15,        ,
 | 
				
			||||||
 | 
					step021 = setptzmovyyd,       -,       -,       -,       -,       2,       -,       5,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step022 = setptzmovyyu,       -,       -,       -,       -,       4,       -,       3,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step023 = setptzmovxxl,       -,       -,       -,       -,       4,       -,       3,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step024 = setptzmovxxr,       -,       -,       -,       -,       2,       -,       5,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step025 = setptzmovzzi,       -,       -,       -,       -,       7,       -,       3,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step026 = setptzmovzzo,       -,       -,       -,       -,       7,       -,       3,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step027 = setptztostop,       -,       -,       -,       -,       -,       -,       3,        ,
 | 
				
			||||||
 | 
					step031 = setptzpreset,       -,       -,       -,       2,       1,       -,      15,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step041 = setcameramov,      33,      33,      66,       -,       -,       -,       5,        , 'x: -100..100, y: -100..100, z: -100..100, duration: 0..180000'
 | 
				
			||||||
 | 
					step042 = setcameramov,     -66,     -66,     -99,       -,       -,    5000,       0,        , 'x: -100..100, y: -100..100, z: -100..100, duration: 0..180000'
 | 
				
			||||||
 | 
					step043 = setcamerapos,       0,       0,       0,       -,       -,       -,      15,        , 'x: 0..3600, y: -900..2700, z: 0..1000'
 | 
				
			||||||
 | 
					step051 = setposashome,       -,       -,       -,       -,       -,       -,     3.5,        ,
 | 
				
			||||||
 | 
					step061 = settextonosd,       0,       0,       -,       -,       -,       -,       3,   hello, 'x|y: osd text position, text: text for osd without quotes or commas'
 | 
				
			||||||
 | 
					step062 = settextonosd,       0,       0,       -,       -,       -,       -,       3, sensor-config:sensor.test.local, 'if a sensor configuration is specified, the sensor value is used instead of text'
 | 
				
			||||||
 | 
					step063 = settextonosd,       0,       0,       -,       -,       -,       -,       3,        , 'an empty text value is used to clear the osd'
 | 
				
			||||||
 | 
					step071 = downloadjpeg,    1280,     720,       -,       -,       -,       -,       5,        , 'name: filename prefix, x|y: camera width|height resolution'
 | 
				
			||||||
 | 
					step999 = rebootcamera,       -,       -,       -,       -,       -,       -,     120,        ,
 | 
				
			||||||
							
								
								
									
										1632
									
								
								archive/0.3/cctv-scheduler.py
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										1632
									
								
								archive/0.3/cctv-scheduler.py
									
									
									
									
									
										Executable file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										169
									
								
								archive/0.4/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										169
									
								
								archive/0.4/README.md
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,169 @@
 | 
				
			||||||
 | 
					# cctv-scheduler
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					PTZ IP-Camera management
 | 
				
			||||||
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- [`cctv-scheduler.py`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#cctv-scheduler-py)
 | 
				
			||||||
 | 
					- [`publisher.sh`](https://git.hmp.today/pavel.muhortov/cctv-scheduler#publisher-sh)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `Installation`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `Requirements`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Cameras settings:
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - Configuration -> System -> Security -> Authentication -> RTSP Authentication: digest/basic
 | 
				
			||||||
 | 
					> - Configuration -> System -> Security -> Authentication -> WEB Authentication: digest/basic
 | 
				
			||||||
 | 
					> - Configuration -> Network -> Advanced Settings -> Integration Protocol -> Enable Hikvision-CGI: Enabled
 | 
				
			||||||
 | 
					> - Configuration -> Network -> Advanced Settings -> Integration Protocol -> Hikvision-CGI Authentication: digest/basic
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Look at the description of dependencies and install the necessary.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `Downloading`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Download scripts and configs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/cctv-scheduler.py -O /home/user/cctv-scheduler/cctv-scheduler.py
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/cctv-scheduler.conf -O /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher.sh -O /home/user/cctv-scheduler/publisher.sh
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher.conf -O /home/user/cctv-scheduler/publisher.conf
 | 
				
			||||||
 | 
					wget https://git.hmp.today/pavel.muhortov/cctv-scheduler/raw/branch/master/publisher-template-page-1007.xml -O /home/user/cctv-scheduler/publisher-template-page-1007.xml
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `Configuration`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Edit configs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					nano /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
 | 
					nano /home/user/cctv-scheduler/publisher.conf
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### `Scheduler`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Look at examples and edit scheduler tasks:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					crontab -e
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `cctv-scheduler`.py
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Description:**  
 | 
				
			||||||
 | 
					> [Hikvision](https://git.hmp.today/pavel.muhortov/cctv-scheduler/src/branch/master/info/hikvision/manual/isapi.pdf) PTZ IP-Camera management. Media streaming. Images to video converting.  
 | 
				
			||||||
 | 
					> Additionally:
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - getting temperature from DS18B20 over SSH,
 | 
				
			||||||
 | 
					> - saving pictures to FTP.
 | 
				
			||||||
 | 
					> - converting picture collection to video.
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> This is only a local "proof of concept" for testing and debugging.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Dependencies:**  
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - [Python 3](https://www.python.org/downloads/) (tested version 3.9.5 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [paramiko](https://www.paramiko.org/) Python 3 module (tested version 3.1.0)
 | 
				
			||||||
 | 
					> - [ffmpeg](https://ffmpeg.org) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - specified record pictures filesystem organization
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					>```bash
 | 
				
			||||||
 | 
					> # record pictures filesystem organization example
 | 
				
			||||||
 | 
					>/root/
 | 
				
			||||||
 | 
					>      /2022/
 | 
				
			||||||
 | 
					>           /12/
 | 
				
			||||||
 | 
					>              /52/
 | 
				
			||||||
 | 
					>                 /31/
 | 
				
			||||||
 | 
					>                    /image-01_2022.12.31_time.jpeg
 | 
				
			||||||
 | 
					>                    /image-02_2022.12.31_time.jpeg
 | 
				
			||||||
 | 
					>      /2023/
 | 
				
			||||||
 | 
					>           /01/
 | 
				
			||||||
 | 
					>              /01/
 | 
				
			||||||
 | 
					>                 /02/
 | 
				
			||||||
 | 
					>                    /image-01_2023.01.02_time.jpeg
 | 
				
			||||||
 | 
					>                    /image-02_2023.01.02_time.jpeg
 | 
				
			||||||
 | 
					>                 /03/
 | 
				
			||||||
 | 
					>                    /image-01_2023.01.03_time.jpeg
 | 
				
			||||||
 | 
					>                    /image-02_2023.01.03_time.jpeg
 | 
				
			||||||
 | 
					>```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					|  PARAMETERS | DESCRIPTION | DEFAULT|
 | 
				
			||||||
 | 
					|-------------|-------------|--------|
 | 
				
			||||||
 | 
					|**[-h]**|print help and exit||
 | 
				
			||||||
 | 
					|**[-b, --broadcast]**|streaming media to destination|`None`|
 | 
				
			||||||
 | 
					|**[-s, --sequences]**|run sequences from config file|`None`|
 | 
				
			||||||
 | 
					|**[--config]**|custom configuration file path|`./cctv-scheduler.conf`|
 | 
				
			||||||
 | 
					|**[-c, --converter]**|convert JPEG collection to MP4|`None`|
 | 
				
			||||||
 | 
					|**[-d, --day]**|day in amount of days from today, for which the publication or conversion is made|`0`|
 | 
				
			||||||
 | 
					|**[-w, --week]**|week in amount of weeks from today, for which the publication or conversion is made|`0`|
 | 
				
			||||||
 | 
					|**[-m, --month]**|month in amount of months from today, for which the publication or conversion is made|`0`|
 | 
				
			||||||
 | 
					|**[-y, --year]**|year in amount of years from today, for which the publication or conversion is made|`0`|
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage in terminal with make the script executable:  
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					chmod u+x ./cctv-scheduler.py
 | 
				
			||||||
 | 
					./cctv-scheduler.py -s --config /home/user/cctv-scheduler/cctv-scheduler.conf
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage with cron:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					# crontab -e
 | 
				
			||||||
 | 
					*  *  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -b
 | 
				
			||||||
 | 
					0  *  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -s
 | 
				
			||||||
 | 
					1  0  *  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -c -d -1
 | 
				
			||||||
 | 
					7  0  *  *  1 /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -c -w -1
 | 
				
			||||||
 | 
					30 0  1  *  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -c -m -1
 | 
				
			||||||
 | 
					36 0  1  1  * /usr/bin/python3 /home/user/cctv-scheduler/cctv-scheduler.py -c -y -1
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					____
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					## `publisher`.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Description:**
 | 
				
			||||||
 | 
					> Uploading MP4 to [Wordpress](https://wordpress.com/) and [Telegram](https://web.telegram.org/).  
 | 
				
			||||||
 | 
					> Additionally:
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - editing [Wordpress](https://codex.wordpress.org/XML-RPC_WordPress_API) page from template
 | 
				
			||||||
 | 
					> - recompressing video if size [over 50MB](https://core.telegram.org/bots/api#sendvideo)
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> This is only a local "proof of conept" for testing and debugging.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					**Dependencies:**  
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> - [bash](https://www.gnu.org/software/bash/) (tested version 5.1.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [curl](https://curl.se/download.html) (tested version 7.74 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [ffmpeg](https://ffmpeg.org/download.html) (tested version 4.3.4 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [libxml2-utils](https://gitlab.gnome.org/GNOME/libxml2) (tested version 2.9.10 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					> - [jq](https://stedolan.github.io/jq/download/) (tested version 1.6 on [Debian GNU/Linux 11](http://ftp.debian.org/debian/dists/bullseye/))
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					|  POSITION | PARAMETERS   |       DESCRIPTION      |    DEFAULT    |
 | 
				
			||||||
 | 
					|-----------|--------------|------------------------|---------------|
 | 
				
			||||||
 | 
					|     1     |    **[qn]**    |execution without pauses||
 | 
				
			||||||
 | 
					|     2     |    **[/path/to/conf]**    |path to config|     `./publisher.conf`   |
 | 
				
			||||||
 | 
					|     3     |    **[-d\|-w\|-m\|-y]**    |periods: '' - 0 day \| '-d' - -X day \| '-w' - -X week \| '-m' - -X month \| '-y' - -X year|`''`|
 | 
				
			||||||
 | 
					|     4     |    **[1\|2\|3..XXX]**    |multiplier for period: '' - 1 day\|week\|month\|year|`1`|
 | 
				
			||||||
 | 
					|     5     |    **[--onlytg\|--onlywp]**    |'--onlytg' - only publish to Telegram \|'--onlywp' - only publish to Wordpress||
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage in terminal with bash for publish to Telegram today's MP4:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					bash ./publisher.sh - ./publisher.conf - - - - --onlytg
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Example usage with cron:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					```bash
 | 
				
			||||||
 | 
					# crontab -e
 | 
				
			||||||
 | 
					1  1  *  *  * bash /home/user/cctv-scheduler/publisher.sh qn - -d
 | 
				
			||||||
 | 
					7  1  *  *  1 bash /home/user/cctv-scheduler/publisher.sh qn - -w
 | 
				
			||||||
 | 
					30 1  1  *  * bash /home/user/cctv-scheduler/publisher.sh qn - -m
 | 
				
			||||||
 | 
					36 1  1  1  * bash /home/user/cctv-scheduler/publisher.sh qn - -y
 | 
				
			||||||
 | 
					```
 | 
				
			||||||
							
								
								
									
										136
									
								
								archive/0.4/cctv-scheduler.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										136
									
								
								archive/0.4/cctv-scheduler.conf
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,136 @@
 | 
				
			||||||
 | 
					[common]
 | 
				
			||||||
 | 
					# By default, a temporary files directory is created in the same path where the script is located.
 | 
				
			||||||
 | 
					# If you need change it, uncomment the parameter and set the path you want.
 | 
				
			||||||
 | 
					#temp_path = /tmp/cctv-scheduler
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# By default, logs use the same directory where the script is located.
 | 
				
			||||||
 | 
					# If you need change it, uncomment the parameter and set the path you want.
 | 
				
			||||||
 | 
					#log_root = /var/log/cctv-scheduler
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# The default log level is "INFO".
 | 
				
			||||||
 | 
					# If you get errors or want to change the logging level, uncomment the parameter and set the level you want:
 | 
				
			||||||
 | 
					#   DEBUG, INFO, WARNING, ERROR, CRITICAL.
 | 
				
			||||||
 | 
					#log_level = DEBUG
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-broadcast]
 | 
				
			||||||
 | 
					# List the broadcast block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-sequences]
 | 
				
			||||||
 | 
					# List the sequence/camera block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-sensors]
 | 
				
			||||||
 | 
					# List the sensor block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					sensor.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-convert]
 | 
				
			||||||
 | 
					# List the convert block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[broadcast-config:camera.test.local]
 | 
				
			||||||
 | 
					# Broadcast parameter description block always starts with "broadcast-config:".
 | 
				
			||||||
 | 
					src = rtsp://user:pass@192.168.254.253:554/Streaming/Channels/101,http://radio.fm:8000/stream.mp3
 | 
				
			||||||
 | 
					dst = rtp://239.0.0.1:5554
 | 
				
			||||||
 | 
					# Optionality you can change video stream framerate.
 | 
				
			||||||
 | 
					#fps = 25
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Optionality you can set YouTube recommended preset:
 | 
				
			||||||
 | 
					#   240p, 360p, 480p, 720p, 1080p, 1440p, 2160p.
 | 
				
			||||||
 | 
					#preset = 1080p
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# By default ffmpeg expected in /usr/bin/ffmpeg or C:\Program Files\ffmpeg\bin\ffmpeg.exe.
 | 
				
			||||||
 | 
					# If you need change it, uncomment the parameter and set the path you want.
 | 
				
			||||||
 | 
					#ffpath = /usr/bin/ffmpeg
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# If you get program freezes because your network unstable, uncomment the parameter.
 | 
				
			||||||
 | 
					#watchdog = true
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# By default, watchdog waits 5 seconds before terminating the program.
 | 
				
			||||||
 | 
					# If you need change it, uncomment the parameter and set the path you want.
 | 
				
			||||||
 | 
					#watchsec = 15
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# If you use crontab or other scheduler to run, uncomment the parameter to prevent process overlap.
 | 
				
			||||||
 | 
					#onlyonce = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[sensor-config:sensor.test.local]
 | 
				
			||||||
 | 
					# Remote host's sensor parameter description block always starts with "sensor-config:".
 | 
				
			||||||
 | 
					hostname = 192.168.254.252
 | 
				
			||||||
 | 
					username = user
 | 
				
			||||||
 | 
					userpass = pass
 | 
				
			||||||
 | 
					# To recognize options for polling a sensor, you must specify the type of sensor.
 | 
				
			||||||
 | 
					# Supported types:
 | 
				
			||||||
 | 
					#   ds18b20
 | 
				
			||||||
 | 
					nodetype = ds18b20
 | 
				
			||||||
 | 
					nodename = 28-1a2b3c4d5e6f
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[camera-config:camera.test.local]
 | 
				
			||||||
 | 
					# Camera parameter description block always starts with "camera-config:".
 | 
				
			||||||
 | 
					hostname = 192.168.254.253
 | 
				
			||||||
 | 
					username = user
 | 
				
			||||||
 | 
					userpass = pass
 | 
				
			||||||
 | 
					# If a record directory on a remote host is used, a username and password must be specified.
 | 
				
			||||||
 | 
					# Supported protocols:
 | 
				
			||||||
 | 
					#   FTP, SFTP.
 | 
				
			||||||
 | 
					records_root_path = ftp://192.168.254.254/Records/camera.test.local
 | 
				
			||||||
 | 
					records_root_user = user
 | 
				
			||||||
 | 
					records_root_pass = pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[camera-sequences:camera.test.local]
 | 
				
			||||||
 | 
					# Camera sequence description block always starts with "camera-sequences:".
 | 
				
			||||||
 | 
					# Place only the sequence of PTZ-actions in this block!
 | 
				
			||||||
 | 
					# Variable name can be anything. Only 'downloadjpeg' is using this for filename prefix.
 | 
				
			||||||
 | 
					# Available actions: 
 | 
				
			||||||
 | 
					#   setcamerapos, setcameramov, settextonosd, downloadjpeg, capabilities, getcamerapos,
 | 
				
			||||||
 | 
					#   setptzmovyyu, setptzmovyyd, setptzmovxxl, setptzmovxxr, setptzmovzzi, setptzmovzzo,
 | 
				
			||||||
 | 
					#   setptzpreset, setptztostop, setmovtohome, setposashome, rebootcamera.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Format (spaces are used for readability only):
 | 
				
			||||||
 | 
					#  name =       action,       x,       y,    zoom,  preset,   speed,   d(ms),    w(s),    text, notes or anything
 | 
				
			||||||
 | 
					step001 = capabilities,       -,       -,       -,       -,       -,       -,       3,        ,
 | 
				
			||||||
 | 
					step002 = getcamerapos,       -,       -,       -,       -,       -,       -,       3,        ,
 | 
				
			||||||
 | 
					step011 = setmovtohome,       -,       -,       -,       -,       -,       -,      15,        ,
 | 
				
			||||||
 | 
					step021 = setptzmovyyd,       -,       -,       -,       -,       2,       -,       5,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step022 = setptzmovyyu,       -,       -,       -,       -,       4,       -,       3,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step023 = setptzmovxxl,       -,       -,       -,       -,       4,       -,       3,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step024 = setptzmovxxr,       -,       -,       -,       -,       2,       -,       5,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step025 = setptzmovzzi,       -,       -,       -,       -,       7,       -,       3,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step026 = setptzmovzzo,       -,       -,       -,       -,       7,       -,       3,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step027 = setptztostop,       -,       -,       -,       -,       -,       -,       3,        ,
 | 
				
			||||||
 | 
					step031 = setptzpreset,       -,       -,       -,       2,       1,       -,      15,        , 'speed: 1..7'
 | 
				
			||||||
 | 
					step041 = setcameramov,      33,      33,      66,       -,       -,       -,       5,        , 'x: -100..100, y: -100..100, z: -100..100, duration: 0..180000'
 | 
				
			||||||
 | 
					step042 = setcameramov,     -66,     -66,     -99,       -,       -,    5000,       0,        , 'x: -100..100, y: -100..100, z: -100..100, duration: 0..180000'
 | 
				
			||||||
 | 
					step043 = setcamerapos,       0,       0,       0,       -,       -,       -,      15,        , 'x: 0..3600, y: -900..2700, z: 0..1000'
 | 
				
			||||||
 | 
					step051 = setposashome,       -,       -,       -,       -,       -,       -,     3.5,        ,
 | 
				
			||||||
 | 
					step061 = settextonosd,       0,       0,       -,       -,       -,       -,       3,   hello, 'x|y: osd text position, text: text for osd without quotes or commas'
 | 
				
			||||||
 | 
					step062 = settextonosd,       0,       0,       -,       -,       -,       -,       3, sensor-config:sensor.test.local, 'if a sensor configuration is specified, the sensor value is used instead of text'
 | 
				
			||||||
 | 
					step063 = settextonosd,       0,       0,       -,       -,       -,       -,       3,        , 'an empty text value is used to clear the osd'
 | 
				
			||||||
 | 
					step071 = downloadjpeg,    1920,    1080,       -,       -,       -,       -,       5,        , 'name: filename prefix, x|y: camera width|height resolution'
 | 
				
			||||||
 | 
					step999 = rebootcamera,       -,       -,       -,       -,       -,       -,     120,        ,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[convert-config:camera.test.local]
 | 
				
			||||||
 | 
					# Converter parameter description block always starts with "convert-config:".
 | 
				
			||||||
 | 
					image_find_names = step071, image-01, image-02
 | 
				
			||||||
 | 
					# If a image root or destination video directories on a remote host is used, a username and password must be specified.
 | 
				
			||||||
 | 
					# Supported protocols:
 | 
				
			||||||
 | 
					#   FTP.
 | 
				
			||||||
 | 
					image_root_path = ftp://192.168.254.254/Records/camera.test.local
 | 
				
			||||||
 | 
					image_root_user = user
 | 
				
			||||||
 | 
					image_root_pass = pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					video_dest_path = ftp://192.168.254.254/Downloads
 | 
				
			||||||
 | 
					video_dest_user = user
 | 
				
			||||||
 | 
					video_dest_pass = pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					video_scale_x = 1920
 | 
				
			||||||
 | 
					video_scale_y = 1080
 | 
				
			||||||
 | 
					video_framerate = 25
 | 
				
			||||||
							
								
								
									
										3308
									
								
								archive/0.4/cctv-scheduler.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3308
									
								
								archive/0.4/cctv-scheduler.py
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										525
									
								
								archive/0.4/publisher-template-page-1007.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										525
									
								
								archive/0.4/publisher-template-page-1007.xml
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,525 @@
 | 
				
			||||||
 | 
					<?xml version="1.0" encoding="UTF-8"?>
 | 
				
			||||||
 | 
					<methodCall><methodName>wp.editPage</methodName>
 | 
				
			||||||
 | 
						<params>
 | 
				
			||||||
 | 
							<param><value>1</value></param>
 | 
				
			||||||
 | 
							<param><value>wpeditpageid</value></param>
 | 
				
			||||||
 | 
							<param><value>wpxmlrpcuser</value></param>
 | 
				
			||||||
 | 
							<param><value>wpxmlrpcpass</value></param>
 | 
				
			||||||
 | 
							<param><value><struct>
 | 
				
			||||||
 | 
								<member><name>dateCreated</name><value><dateTime.iso8601>wpeditdateis</dateTime.iso8601></value></member>
 | 
				
			||||||
 | 
								<member><name>userid</name><value><string>wpedituserid</string></value></member>
 | 
				
			||||||
 | 
								<member><name>page_id</name><value><int>wpeditpageid</int></value></member>
 | 
				
			||||||
 | 
								<member><name>page_status</name><value><string>publish</string></value></member>
 | 
				
			||||||
 | 
								<member><name>description</name><value><string>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									<!-- wp:heading {"level":3} --><h3>Now</h3><!-- /wp:heading -->
 | 
				
			||||||
 | 
									<!-- wp:embed {"url":"youtubelink","type":"video","providerNameSlug":"youtube",
 | 
				
			||||||
 | 
										"responsive":true,"className":"wp-embed-aspect-4-3 wp-has-aspect-ratio"} -->
 | 
				
			||||||
 | 
										<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio">
 | 
				
			||||||
 | 
										<div class="wp-block-embed__wrapper">
 | 
				
			||||||
 | 
										youtubelink
 | 
				
			||||||
 | 
										</div></figure><!-- /wp:embed -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									<!-- wp:heading {"level":3} --><h3>Yesterday</h3><!-- /wp:heading -->
 | 
				
			||||||
 | 
									<!-- wp:uagb/tabs {"block_id":"yesterday",
 | 
				
			||||||
 | 
										"tabHeaders":["currentdp01[0]",
 | 
				
			||||||
 | 
																"currentdp02[0]",
 | 
				
			||||||
 | 
																"currentdp04[0]",
 | 
				
			||||||
 | 
																"currentdp05[0]",
 | 
				
			||||||
 | 
																"currentdp11[0]",
 | 
				
			||||||
 | 
																"currentdp12[0]"],"tabActive":5,"activeTabBgColor":"#4b4b4b",
 | 
				
			||||||
 | 
										"tabTitleLeftMargin":1,"tabTitleRightMargin":1,"tabTitleTopMargin":1,"tabTitleBottomMargin":1} -->
 | 
				
			||||||
 | 
									<div class="wp-block-uagb-tabs uagb-block-yesterday uagb-tabs__wrap uagb-tabs__hstyle1-desktop uagb-tabs__vstyle6-tablet uagb-tabs__vstyle6-mobile" data-tab-active="0">
 | 
				
			||||||
 | 
									<ul class="uagb-tabs__panel uagb-tabs__align-left"><li class="uagb-tab uagb-tabs__active">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab0" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="0">
 | 
				
			||||||
 | 
									<span>currentdp01[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab1" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="1">
 | 
				
			||||||
 | 
									<span>currentdp02[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab2" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="2">
 | 
				
			||||||
 | 
									<span>currentdp04[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab3" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="3">
 | 
				
			||||||
 | 
									<span>currentdp05[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab4" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="4">
 | 
				
			||||||
 | 
									<span>currentdp11[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab5" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="5">
 | 
				
			||||||
 | 
									<span>currentdp12[0]</span></a></li></ul>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<div class="uagb-tabs__body-wrap">
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"daypoint01",
 | 
				
			||||||
 | 
											"header":"currentdp01[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentdp01[0]",
 | 
				
			||||||
 | 
																	"currentdp02[0]",
 | 
				
			||||||
 | 
																	"currentdp04[0]",
 | 
				
			||||||
 | 
																	"currentdp05[0]",
 | 
				
			||||||
 | 
																	"currentdp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-0">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__daypoint01 uagb-tabs__body" aria-labelledby="uagb-tabs__tab0">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1036} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentdp01[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"daypoint02","id":1,
 | 
				
			||||||
 | 
											"header":"currentdp02[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentdp01[0]",
 | 
				
			||||||
 | 
																	"currentdp02[0]",
 | 
				
			||||||
 | 
																	"currentdp04[0]",
 | 
				
			||||||
 | 
																	"currentdp05[0]",
 | 
				
			||||||
 | 
																	"currentdp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-1">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__daypoint02 uagb-tabs__body" aria-labelledby="uagb-tabs__tab1">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1041} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentdp02[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"daypoint04","id":2,
 | 
				
			||||||
 | 
											"header":"currentdp04[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentdp01[0]",
 | 
				
			||||||
 | 
																	"currentdp02[0]",
 | 
				
			||||||
 | 
																	"currentdp04[0]",
 | 
				
			||||||
 | 
																	"currentdp05[0]",
 | 
				
			||||||
 | 
																	"currentdp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-2">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__daypoint04 uagb-tabs__body" aria-labelledby="uagb-tabs__tab2">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1046} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentdp04[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"daypoint05","id":3,
 | 
				
			||||||
 | 
											"header":"currentdp05[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentdp01[0]",
 | 
				
			||||||
 | 
																	"currentdp02[0]",
 | 
				
			||||||
 | 
																	"currentdp04[0]",
 | 
				
			||||||
 | 
																	"currentdp05[0]",
 | 
				
			||||||
 | 
																	"currentdp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-3">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__daypoint05 uagb-tabs__body" aria-labelledby="uagb-tabs__tab3">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1051} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentdp05[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"daypoint11","id":4,
 | 
				
			||||||
 | 
											"header":"currentdp11[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentdp01[0]",
 | 
				
			||||||
 | 
																	"currentdp02[0]",
 | 
				
			||||||
 | 
																	"currentdp04[0]",
 | 
				
			||||||
 | 
																	"currentdp05[0]",
 | 
				
			||||||
 | 
																	"currentdp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-4">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__daypoint11 uagb-tabs__body" aria-labelledby="uagb-tabs__tab4">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1056} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentdp11[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"daypoint12","id":5,
 | 
				
			||||||
 | 
											"header":"currentdp12[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentdp01[0]",
 | 
				
			||||||
 | 
																	"currentdp02[0]",
 | 
				
			||||||
 | 
																	"currentdp04[0]",
 | 
				
			||||||
 | 
																	"currentdp05[0]",
 | 
				
			||||||
 | 
																	"currentdp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-5">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__daypoint12 uagb-tabs__body" aria-labelledby="uagb-tabs__tab5">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1061} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentdp12[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child --></div></div>
 | 
				
			||||||
 | 
										<!-- /wp:uagb/tabs -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									<!-- wp:heading {"level":3} --><h3>Last week</h3><!-- /wp:heading -->
 | 
				
			||||||
 | 
									<!-- wp:uagb/tabs {"block_id":"lastweek",
 | 
				
			||||||
 | 
										"tabHeaders":["currentwp01[0]",
 | 
				
			||||||
 | 
																"currentwp02[0]",
 | 
				
			||||||
 | 
																"currentwp04[0]",
 | 
				
			||||||
 | 
																"currentwp05[0]",
 | 
				
			||||||
 | 
																"currentwp11[0]",
 | 
				
			||||||
 | 
																"currentwp12[0]"],"tabActive":5,"activeTabBgColor":"#4b4b4b",
 | 
				
			||||||
 | 
										"tabTitleLeftMargin":1,"tabTitleRightMargin":1,"tabTitleTopMargin":1,"tabTitleBottomMargin":1} -->
 | 
				
			||||||
 | 
									<div class="wp-block-uagb-tabs uagb-block-lastweek uagb-tabs__wrap uagb-tabs__hstyle1-desktop uagb-tabs__vstyle6-tablet uagb-tabs__vstyle6-mobile" data-tab-active="0">
 | 
				
			||||||
 | 
									<ul class="uagb-tabs__panel uagb-tabs__align-left"><li class="uagb-tab uagb-tabs__active">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab0" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="0">
 | 
				
			||||||
 | 
									<span>currentwp01[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab1" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="1">
 | 
				
			||||||
 | 
									<span>currentwp02[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab2" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="2">
 | 
				
			||||||
 | 
									<span>currentwp04[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab3" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="3">
 | 
				
			||||||
 | 
									<span>currentwp05[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab4" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="4">
 | 
				
			||||||
 | 
									<span>currentwp11[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab5" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="5">
 | 
				
			||||||
 | 
									<span>currentwp12[0]</span></a></li></ul>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<div class="uagb-tabs__body-wrap">
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"weekpoint01",
 | 
				
			||||||
 | 
											"header":"currentwp01[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentwp01[0]",
 | 
				
			||||||
 | 
																	"currentwp02[0]",
 | 
				
			||||||
 | 
																	"currentwp04[0]",
 | 
				
			||||||
 | 
																	"currentwp05[0]",
 | 
				
			||||||
 | 
																	"currentwp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-0">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__weekpoint01 uagb-tabs__body" aria-labelledby="uagb-tabs__tab0">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1036} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentwp01[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"weekpoint02","id":1,
 | 
				
			||||||
 | 
											"header":"currentwp02[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentwp01[0]",
 | 
				
			||||||
 | 
																	"currentwp02[0]",
 | 
				
			||||||
 | 
																	"currentwp04[0]",
 | 
				
			||||||
 | 
																	"currentwp05[0]",
 | 
				
			||||||
 | 
																	"currentwp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-1">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__weekpoint02 uagb-tabs__body" aria-labelledby="uagb-tabs__tab1">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1041} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentwp02[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"weekpoint04","id":2,
 | 
				
			||||||
 | 
											"header":"currentwp04[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentwp01[0]",
 | 
				
			||||||
 | 
																	"currentwp02[0]",
 | 
				
			||||||
 | 
																	"currentwp04[0]",
 | 
				
			||||||
 | 
																	"currentwp05[0]",
 | 
				
			||||||
 | 
																	"currentwp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-2">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__weekpoint04 uagb-tabs__body" aria-labelledby="uagb-tabs__tab2">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1046} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentwp04[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"weekpoint05","id":3,
 | 
				
			||||||
 | 
											"header":"currentwp05[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentwp01[0]",
 | 
				
			||||||
 | 
																	"currentwp02[0]",
 | 
				
			||||||
 | 
																	"currentwp04[0]",
 | 
				
			||||||
 | 
																	"currentwp05[0]",
 | 
				
			||||||
 | 
																	"currentwp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-3">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__weekpoint05 uagb-tabs__body" aria-labelledby="uagb-tabs__tab3">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1051} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentwp05[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"weekpoint11","id":4,
 | 
				
			||||||
 | 
											"header":"currentwp11[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentwp01[0]",
 | 
				
			||||||
 | 
																	"currentwp02[0]",
 | 
				
			||||||
 | 
																	"currentwp04[0]",
 | 
				
			||||||
 | 
																	"currentwp05[0]",
 | 
				
			||||||
 | 
																	"currentwp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-4">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__weekpoint11 uagb-tabs__body" aria-labelledby="uagb-tabs__tab4">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1056} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentwp11[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"weekpoint12","id":5,
 | 
				
			||||||
 | 
											"header":"currentwp12[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentwp01[0]",
 | 
				
			||||||
 | 
																	"currentwp02[0]",
 | 
				
			||||||
 | 
																	"currentwp04[0]",
 | 
				
			||||||
 | 
																	"currentwp05[0]",
 | 
				
			||||||
 | 
																	"currentwp11[0]","wp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-5">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__weekpoint12 uagb-tabs__body" aria-labelledby="uagb-tabs__tab5">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1061} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentwp12[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child --></div></div>
 | 
				
			||||||
 | 
										<!-- /wp:uagb/tabs -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									<!-- wp:heading {"level":3} --><h3>Last month</h3><!-- /wp:heading -->
 | 
				
			||||||
 | 
									<!-- wp:uagb/tabs {"block_id":"lastmonth",
 | 
				
			||||||
 | 
										"tabHeaders":["currentmp01[0]",
 | 
				
			||||||
 | 
																"currentmp02[0]",
 | 
				
			||||||
 | 
																"currentmp04[0]",
 | 
				
			||||||
 | 
																"currentmp05[0]",
 | 
				
			||||||
 | 
																"currentmp11[0]",
 | 
				
			||||||
 | 
																"currentmp12[0]"],"tabActive":5,"activeTabBgColor":"#4b4b4b",
 | 
				
			||||||
 | 
										"tabTitleLeftMargin":1,"tabTitleRightMargin":1,"tabTitleTopMargin":1,"tabTitleBottomMargin":1} -->
 | 
				
			||||||
 | 
									<div class="wp-block-uagb-tabs uagb-block-lastmonth uagb-tabs__wrap uagb-tabs__hstyle1-desktop uagb-tabs__vstyle6-tablet uagb-tabs__vstyle6-mobile" data-tab-active="0">
 | 
				
			||||||
 | 
									<ul class="uagb-tabs__panel uagb-tabs__align-left"><li class="uagb-tab uagb-tabs__active">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab0" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="0">
 | 
				
			||||||
 | 
									<span>currentmp01[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab1" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="1">
 | 
				
			||||||
 | 
									<span>currentmp02[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab2" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="2">
 | 
				
			||||||
 | 
									<span>currentmp04[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab3" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="3">
 | 
				
			||||||
 | 
									<span>currentmp05[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab4" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="4">
 | 
				
			||||||
 | 
									<span>currentmp11[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab5" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="5">
 | 
				
			||||||
 | 
									<span>currentmp12[0]</span></a></li></ul>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<div class="uagb-tabs__body-wrap">
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"monthpoint01",
 | 
				
			||||||
 | 
											"header":"currentmp01[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentmp01[0]",
 | 
				
			||||||
 | 
																	"currentmp02[0]",
 | 
				
			||||||
 | 
																	"currentmp04[0]",
 | 
				
			||||||
 | 
																	"currentmp05[0]",
 | 
				
			||||||
 | 
																	"currentmp11[0]","mp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-0">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__monthpoint01 uagb-tabs__body" aria-labelledby="uagb-tabs__tab0">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1037} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentmp01[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"monthpoint02","id":1,
 | 
				
			||||||
 | 
											"header":"currentmp02[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentmp01[0]",
 | 
				
			||||||
 | 
																	"currentmp02[0]",
 | 
				
			||||||
 | 
																	"currentmp04[0]",
 | 
				
			||||||
 | 
																	"currentmp05[0]",
 | 
				
			||||||
 | 
																	"currentmp11[0]","mp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-1">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__monthpoint02 uagb-tabs__body" aria-labelledby="uagb-tabs__tab1">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1042} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentmp02[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"monthpoint04","id":2,
 | 
				
			||||||
 | 
											"header":"currentmp04[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentmp01[0]",
 | 
				
			||||||
 | 
																	"currentmp02[0]",
 | 
				
			||||||
 | 
																	"currentmp04[0]",
 | 
				
			||||||
 | 
																	"currentmp05[0]",
 | 
				
			||||||
 | 
																	"currentmp11[0]","mp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-2">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__monthpoint04 uagb-tabs__body" aria-labelledby="uagb-tabs__tab2">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1047} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentmp04[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"monthpoint05","id":3,
 | 
				
			||||||
 | 
											"header":"currentmp05[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentmp01[0]",
 | 
				
			||||||
 | 
																	"currentmp02[0]",
 | 
				
			||||||
 | 
																	"currentmp04[0]",
 | 
				
			||||||
 | 
																	"currentmp05[0]",
 | 
				
			||||||
 | 
																	"currentmp11[0]","mp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-3">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__monthpoint05 uagb-tabs__body" aria-labelledby="uagb-tabs__tab3">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1052} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentmp05[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"monthpoint11","id":4,
 | 
				
			||||||
 | 
											"header":"currentmp11[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentmp01[0]",
 | 
				
			||||||
 | 
																	"currentmp02[0]",
 | 
				
			||||||
 | 
																	"currentmp04[0]",
 | 
				
			||||||
 | 
																	"currentmp05[0]",
 | 
				
			||||||
 | 
																	"currentmp11[0]","mp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-4">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__monthpoint11 uagb-tabs__body" aria-labelledby="uagb-tabs__tab4">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1057} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentmp11[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"monthpoint12","id":5,
 | 
				
			||||||
 | 
											"header":"currentmp12[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentmp01[0]",
 | 
				
			||||||
 | 
																	"currentmp02[0]",
 | 
				
			||||||
 | 
																	"currentmp04[0]",
 | 
				
			||||||
 | 
																	"currentmp05[0]",
 | 
				
			||||||
 | 
																	"currentmp11[0]","mp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-5">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__monthpoint12 uagb-tabs__body" aria-labelledby="uagb-tabs__tab5">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1062} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentmp12[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child --></div></div>
 | 
				
			||||||
 | 
										<!-- /wp:uagb/tabs -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									<!-- wp:heading {"level":3} --><h3>Last year</h3><!-- /wp:heading -->
 | 
				
			||||||
 | 
									<!-- wp:uagb/tabs {"block_id":"lastyear",
 | 
				
			||||||
 | 
										"tabHeaders":["currentyp01[0]",
 | 
				
			||||||
 | 
																"currentyp02[0]",
 | 
				
			||||||
 | 
																"currentyp04[0]",
 | 
				
			||||||
 | 
																"currentyp05[0]",
 | 
				
			||||||
 | 
																"currentyp11[0]",
 | 
				
			||||||
 | 
																"currentyp12[0]"],"tabActive":5,"activeTabBgColor":"#4b4b4b",
 | 
				
			||||||
 | 
										"tabTitleLeftMargin":1,"tabTitleRightMargin":1,"tabTitleTopMargin":1,"tabTitleBottomMargin":1} -->
 | 
				
			||||||
 | 
									<div class="wp-block-uagb-tabs uagb-block-lastyear uagb-tabs__wrap uagb-tabs__hstyle1-desktop uagb-tabs__vstyle6-tablet uagb-tabs__vstyle6-mobile" data-tab-active="0">
 | 
				
			||||||
 | 
									<ul class="uagb-tabs__panel uagb-tabs__align-left"><li class="uagb-tab uagb-tabs__active">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab0" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="0">
 | 
				
			||||||
 | 
									<span>currentyp01[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab1" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="1">
 | 
				
			||||||
 | 
									<span>currentyp02[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab2" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="2">
 | 
				
			||||||
 | 
									<span>currentyp04[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab3" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="3">
 | 
				
			||||||
 | 
									<span>currentyp05[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab4" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="4">
 | 
				
			||||||
 | 
									<span>currentyp11[0]</span></a></li><li class="uagb-tab ">
 | 
				
			||||||
 | 
									<a href="#uagb-tabs__tab5" class="uagb-tabs-list uagb-tabs__icon-position-left" data-tab="5">
 | 
				
			||||||
 | 
									<span>currentyp12[0]</span></a></li></ul>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<div class="uagb-tabs__body-wrap">
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"yearpoint01",
 | 
				
			||||||
 | 
											"header":"currentyp01[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentyp01[0]",
 | 
				
			||||||
 | 
																	"currentyp02[0]",
 | 
				
			||||||
 | 
																	"currentyp04[0]",
 | 
				
			||||||
 | 
																	"currentyp05[0]",
 | 
				
			||||||
 | 
																	"currentyp11[0]","yp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-0">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__yearpoint01 uagb-tabs__body" aria-labelledby="uagb-tabs__tab0">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1038} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentyp01[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"yearpoint02","id":1,
 | 
				
			||||||
 | 
											"header":"currentyp02[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentyp01[0]",
 | 
				
			||||||
 | 
																	"currentyp02[0]",
 | 
				
			||||||
 | 
																	"currentyp04[0]",
 | 
				
			||||||
 | 
																	"currentyp05[0]",
 | 
				
			||||||
 | 
																	"currentyp11[0]","yp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-1">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__yearpoint02 uagb-tabs__body" aria-labelledby="uagb-tabs__tab1">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1043} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentyp02[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"yearpoint04","id":2,
 | 
				
			||||||
 | 
											"header":"currentyp04[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentyp01[0]",
 | 
				
			||||||
 | 
																	"currentyp02[0]",
 | 
				
			||||||
 | 
																	"currentyp04[0]",
 | 
				
			||||||
 | 
																	"currentyp05[0]",
 | 
				
			||||||
 | 
																	"currentyp11[0]","yp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-2">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__yearpoint04 uagb-tabs__body" aria-labelledby="uagb-tabs__tab2">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1048} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentyp04[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"yearpoint05","id":3,
 | 
				
			||||||
 | 
											"header":"currentyp05[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentyp01[0]",
 | 
				
			||||||
 | 
																	"currentyp02[0]",
 | 
				
			||||||
 | 
																	"currentyp04[0]",
 | 
				
			||||||
 | 
																	"currentyp05[0]",
 | 
				
			||||||
 | 
																	"currentyp11[0]","yp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-3">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__yearpoint05 uagb-tabs__body" aria-labelledby="uagb-tabs__tab3">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1053} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentyp05[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"yearpoint11","id":4,
 | 
				
			||||||
 | 
											"header":"currentyp11[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentyp01[0]",
 | 
				
			||||||
 | 
																	"currentyp02[0]",
 | 
				
			||||||
 | 
																	"currentyp04[0]",
 | 
				
			||||||
 | 
																	"currentyp05[0]",
 | 
				
			||||||
 | 
																	"currentyp11[0]","yp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-4">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__yearpoint11 uagb-tabs__body" aria-labelledby="uagb-tabs__tab4">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1058} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentyp11[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
										<!-- wp:uagb/tabs-child {"block_id":"yearpoint12","id":5,
 | 
				
			||||||
 | 
											"header":"currentyp12[0]","tabActive":5,
 | 
				
			||||||
 | 
											"tabHeaders":["currentyp01[0]",
 | 
				
			||||||
 | 
																	"currentyp02[0]",
 | 
				
			||||||
 | 
																	"currentyp04[0]",
 | 
				
			||||||
 | 
																	"currentyp05[0]",
 | 
				
			||||||
 | 
																	"currentyp11[0]","yp1tab"]} -->
 | 
				
			||||||
 | 
										<div class="wp-block-uagb-tabs-child uagb-tabs__body-container uagb-tabs__inner-tab uagb-inner-tab-5">
 | 
				
			||||||
 | 
										<div class="uagb-blocks__yearpoint12 uagb-tabs__body" aria-labelledby="uagb-tabs__tab5">
 | 
				
			||||||
 | 
										<!-- wp:video {"id":1063} --><figure class="wp-block-video">
 | 
				
			||||||
 | 
										<video controls loop src="currentyp12[1]">
 | 
				
			||||||
 | 
										</video></figure><!-- /wp:video --></div></div><!-- /wp:uagb/tabs-child --></div></div>
 | 
				
			||||||
 | 
										<!-- /wp:uagb/tabs -->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
								</string></value></member>
 | 
				
			||||||
 | 
								<member><name>title</name><value><string>Media</string></value></member>
 | 
				
			||||||
 | 
								<member><name>link</name><value><string>wppagelinkis</string></value></member>
 | 
				
			||||||
 | 
								<member><name>permaLink</name><value><string>wppagelinkis</string></value></member>
 | 
				
			||||||
 | 
								<member><name>categories</name><value><array><data></data></array></value></member>
 | 
				
			||||||
 | 
								<member><name>excerpt</name><value><string></string></value></member>
 | 
				
			||||||
 | 
								<member><name>text_more</name><value><string></string></value></member>
 | 
				
			||||||
 | 
								<member><name>mt_allow_comments</name><value><int>0</int></value></member>
 | 
				
			||||||
 | 
								<member><name>mt_allow_pings</name><value><int>0</int></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_slug</name><value><string>media</string></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_password</name><value><string></string></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_author</name><value><string>wppageauthor</string></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_page_parent_id</name><value><int>0</int></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_page_parent_title</name><value><string></string></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_page_order</name><value><int>0</int></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_author_id</name><value><string>wpedituserid</string></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_author_display_name</name><value><string>wppageauthor</string></value></member>
 | 
				
			||||||
 | 
								<member><name>date_created_gmt</name><value><dateTime.iso8601>wpeditdateis</dateTime.iso8601></value></member>
 | 
				
			||||||
 | 
								<member><name>custom_fields</name><value><array><data>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4258</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>content_display_featured_image</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>0</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4257</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>content_display_title</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>0</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4259</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>content_width</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>container</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4253</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>disable_space_above_footer</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>0</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4252</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>disable_space_below_header</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>0</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4251</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>hide_footer</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>0</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4250</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>hide_header</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>0</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4254</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>hide_titlebar</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>0</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4255</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>page_overwrite_defaults</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>0</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4260</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>sidebar_layout</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>default-sidebar</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
									<value><struct>
 | 
				
			||||||
 | 
										<member><name>id</name><value><string>4256</string></value></member>
 | 
				
			||||||
 | 
										<member><name>key</name><value><string>titlebar_padding</string></value></member>
 | 
				
			||||||
 | 
										<member><name>value</name><value><string>80</string></value></member>
 | 
				
			||||||
 | 
									</struct></value>
 | 
				
			||||||
 | 
								</data></array></value></member>
 | 
				
			||||||
 | 
								<member><name>wp_page_template</name><value><string>default</string></value></member>
 | 
				
			||||||
 | 
							</struct></value></param>
 | 
				
			||||||
 | 
						</params>
 | 
				
			||||||
 | 
					</methodCall>
 | 
				
			||||||
							
								
								
									
										86
									
								
								archive/0.4/publisher.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								archive/0.4/publisher.conf
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,86 @@
 | 
				
			||||||
 | 
					logs=./publisher.log
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pathroot=/home/user/cctv-scheduler/records
 | 
				
			||||||
 | 
					vidnamesarray=point-01 point-02 point-04 point-05 point-11 point-12
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					telegramapiurl=https://api.telegram.org/bot1234567890:YOURAPIKEY
 | 
				
			||||||
 | 
					telegramchatid=123456789
 | 
				
			||||||
 | 
					tgpreviewlink=https://www.hmp.today/wp-content/uploads/2021/02/site-slider_hmp-qr_bwg-3840x1705-1.png
 | 
				
			||||||
 | 
					tgpreviewtext=https://www.hmp.today/media
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					wpxmlrpclink=https://www.hmp.today/xmlrpc.php
 | 
				
			||||||
 | 
					wpxmlrpcuser=user
 | 
				
			||||||
 | 
					wpxmlrpcpass=pass
 | 
				
			||||||
 | 
					wppageauthor=author
 | 
				
			||||||
 | 
					wppagelinkis=https://www.hmp.today/media
 | 
				
			||||||
 | 
					wpeditpageid=1007
 | 
				
			||||||
 | 
					wpedituserid=0
 | 
				
			||||||
 | 
					wpeditdateis=20220707T00:00:00
 | 
				
			||||||
 | 
					wptemplateis=./publisher-template-page-1007.xml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					youtubelink=https://youtu.be/link
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					defaultdp01=point-01 https://www.hmp.today/wp-content/uploads/2022/07/point-01_yyyy.mm_.dd_.mp4
 | 
				
			||||||
 | 
					defaultwp01=point-01 https://www.hmp.today/wp-content/uploads/2022/07/point-01_w.mp4
 | 
				
			||||||
 | 
					defaultmp01=point-01 https://www.hmp.today/wp-content/uploads/2022/07/point-01_yyyy.mm_.mp4
 | 
				
			||||||
 | 
					defaultyp01=point-01 https://www.hmp.today/wp-content/uploads/2022/07/point-01_yyyy.mp4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					defaultdp02=point-02 https://www.hmp.today/wp-content/uploads/2022/07/point-02_yyyy.mm_.dd_.mp4
 | 
				
			||||||
 | 
					defaultwp02=point-02 https://www.hmp.today/wp-content/uploads/2022/07/point-02_w.mp4
 | 
				
			||||||
 | 
					defaultmp02=point-02 https://www.hmp.today/wp-content/uploads/2022/07/point-02_yyyy.mm_.mp4
 | 
				
			||||||
 | 
					defaultyp02=point-02 https://www.hmp.today/wp-content/uploads/2022/07/point-02_yyyy.mp4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					defaultdp04=point-04 https://www.hmp.today/wp-content/uploads/2022/07/point-04_yyyy.mm_.dd_.mp4
 | 
				
			||||||
 | 
					defaultwp04=point-04 https://www.hmp.today/wp-content/uploads/2022/07/point-04_w.mp4
 | 
				
			||||||
 | 
					defaultmp04=point-04 https://www.hmp.today/wp-content/uploads/2022/07/point-04_yyyy.mm_.mp4
 | 
				
			||||||
 | 
					defaultyp04=point-04 https://www.hmp.today/wp-content/uploads/2022/07/point-04_yyyy.mp4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					defaultdp05=point-05 https://www.hmp.today/wp-content/uploads/2022/07/point-05_yyyy.mm_.dd_.mp4
 | 
				
			||||||
 | 
					defaultwp05=point-05 https://www.hmp.today/wp-content/uploads/2022/07/point-05_w.mp4
 | 
				
			||||||
 | 
					defaultmp05=point-05 https://www.hmp.today/wp-content/uploads/2022/07/point-05_yyyy.mm_.mp4
 | 
				
			||||||
 | 
					defaultyp05=point-05 https://www.hmp.today/wp-content/uploads/2022/07/point-05_yyyy.mp4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					defaultdp11=point-11 https://www.hmp.today/wp-content/uploads/2022/07/point-11_yyyy.mm_.dd_.mp4
 | 
				
			||||||
 | 
					defaultwp11=point-11 https://www.hmp.today/wp-content/uploads/2022/07/point-11_w.mp4
 | 
				
			||||||
 | 
					defaultmp11=point-11 https://www.hmp.today/wp-content/uploads/2022/07/point-11_yyyy.mm_.mp4
 | 
				
			||||||
 | 
					defaultyp11=point-11 https://www.hmp.today/wp-content/uploads/2022/07/point-11_yyyy.mp4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					defaultdp12=point-12 https://www.hmp.today/wp-content/uploads/2022/07/point-12_yyyy.mm_.dd_.mp4
 | 
				
			||||||
 | 
					defaultwp12=point-12 https://www.hmp.today/wp-content/uploads/2022/07/point-12_w.mp4
 | 
				
			||||||
 | 
					defaultmp12=point-12 https://www.hmp.today/wp-content/uploads/2022/07/point-12_yyyy.mm_.mp4
 | 
				
			||||||
 | 
					defaultyp12=point-12 https://www.hmp.today/wp-content/uploads/2022/07/point-12_yyyy.mp4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					currentdp01=point-01
 | 
				
			||||||
 | 
					currentwp01=point-01
 | 
				
			||||||
 | 
					currentmp01=point-01
 | 
				
			||||||
 | 
					currentyp01=point-01
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					currentdp02=point-02
 | 
				
			||||||
 | 
					currentwp02=point-02
 | 
				
			||||||
 | 
					currentmp02=point-02
 | 
				
			||||||
 | 
					currentyp02=point-02
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					currentdp04=point-04
 | 
				
			||||||
 | 
					currentwp04=point-04
 | 
				
			||||||
 | 
					currentmp04=point-04
 | 
				
			||||||
 | 
					currentyp04=point-04
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					currentdp05=point-05
 | 
				
			||||||
 | 
					currentwp05=point-05
 | 
				
			||||||
 | 
					currentmp05=point-05
 | 
				
			||||||
 | 
					currentyp05=point-05
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					currentdp11=point-11
 | 
				
			||||||
 | 
					currentwp11=point-11
 | 
				
			||||||
 | 
					currentmp11=point-11
 | 
				
			||||||
 | 
					currentyp11=point-11
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					currentdp12=point-12
 | 
				
			||||||
 | 
					currentwp12=point-12
 | 
				
			||||||
 | 
					currentmp12=point-12
 | 
				
			||||||
 | 
					currentyp12=point-12
 | 
				
			||||||
							
								
								
									
										599
									
								
								archive/0.4/publisher.sh
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										599
									
								
								archive/0.4/publisher.sh
									
									
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,599 @@
 | 
				
			||||||
 | 
					#! /bin/bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# DESCRIPTION:
 | 
				
			||||||
 | 
					#   Uploading MP4 to Wordpress and Telegram.
 | 
				
			||||||
 | 
					#   Additionally:
 | 
				
			||||||
 | 
					#   - editing Wordpress page from template
 | 
				
			||||||
 | 
					#   - recompressing video if size over 50MB
 | 
				
			||||||
 | 
					#   This is only a local "proof of conept" for testing and debugging.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# DEPENDENCIES:
 | 
				
			||||||
 | 
					#   - curl
 | 
				
			||||||
 | 
					#   - ffmpeg
 | 
				
			||||||
 | 
					#   - libxml2-utils
 | 
				
			||||||
 | 
					#   - jq
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# PARAMETERS:
 | 
				
			||||||
 | 
					#   1: "qn" - execution without pauses
 | 
				
			||||||
 | 
					#   2: custom configuration file path
 | 
				
			||||||
 | 
					#   3: periods: '' - today | '-d' - yesterday | '-w' - last week | '-m' - last month | '-y' - last year
 | 
				
			||||||
 | 
					#   4: period multiplier: '' - 1 day|week|month|year
 | 
				
			||||||
 | 
					#   5: publishing '--onlytg' - only to Telegram | '--onlywp' - only to Wordpress
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# FUNCTIONS:
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					# Print message and add to log.
 | 
				
			||||||
 | 
					# Globals:
 | 
				
			||||||
 | 
					#   logs
 | 
				
			||||||
 | 
					# Arguments:
 | 
				
			||||||
 | 
					#   1: message to print and logging
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					addtologs() {
 | 
				
			||||||
 | 
					  echo "$(date +'%Y.%m.%d-%H:%M:%S') $1" | tee -a "${logs}"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					# Waiting for press [ENTER].
 | 
				
			||||||
 | 
					# Globals:
 | 
				
			||||||
 | 
					#   None
 | 
				
			||||||
 | 
					# Arguments:
 | 
				
			||||||
 | 
					#   None
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					execpause() {
 | 
				
			||||||
 | 
					  read -r -p "Press [ENTER] to continue... "
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					# Exit procedure.
 | 
				
			||||||
 | 
					# Globals:
 | 
				
			||||||
 | 
					#   show
 | 
				
			||||||
 | 
					# Arguments:
 | 
				
			||||||
 | 
					#   None
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					execquite() {
 | 
				
			||||||
 | 
					  addtologs "execution time is $(($(date +%s)-time)) seconds, exit"
 | 
				
			||||||
 | 
					  if [ "${show}" != "qn" ]; then
 | 
				
			||||||
 | 
					  execpause
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  exit
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					# Error exit procedure with Telegram notification.
 | 
				
			||||||
 | 
					# Globals:
 | 
				
			||||||
 | 
					#   telegramapiurl
 | 
				
			||||||
 | 
					#   telegramchatid
 | 
				
			||||||
 | 
					# Arguments:
 | 
				
			||||||
 | 
					#   1: message to print and logging
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					execerror() {
 | 
				
			||||||
 | 
					  addtologs "error: $1"
 | 
				
			||||||
 | 
					  curl -s -X POST "${telegramapiurl}/sendMessage" \
 | 
				
			||||||
 | 
					  -d "chat_id=${telegramchatid}" \
 | 
				
			||||||
 | 
					  -d "text=$(basename -s .sh "$0") error: $1" \
 | 
				
			||||||
 | 
					  >> /dev/null 2>&1
 | 
				
			||||||
 | 
					  execquite
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					# Parsing config file and creating global vars.
 | 
				
			||||||
 | 
					# Globals:
 | 
				
			||||||
 | 
					#   None
 | 
				
			||||||
 | 
					# Arguments:
 | 
				
			||||||
 | 
					#   None
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					getconfig() {
 | 
				
			||||||
 | 
					  logs=$(grep "logs=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  pathroot=$(grep "pathroot=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  IFS=" " read -r -a vidnamesarray <<< "$(grep "vidnamesarray=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  telegramapiurl=$(grep "telegramapiurl=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  telegramchatid=$(grep "telegramchatid=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  tgpreviewlink=$(grep "tgpreviewlink=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  tgpreviewtext=$(grep "tgpreviewtext=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wpxmlrpclink=$(grep "wpxmlrpclink=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wpxmlrpcuser=$(grep "wpxmlrpcuser=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wpxmlrpcpass=$(grep "wpxmlrpcpass=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wppageauthor=$(grep "wppageauthor=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wppagelinkis=$(grep "wppagelinkis=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wpeditpageid=$(grep "wpeditpageid=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wpedituserid=$(grep "wpedituserid=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wpeditdateis=$(grep "wpeditdateis=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  wptemplateis=$(grep "wptemplateis=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					  youtubelink=$(grep "youtubelink=" "${conf}" | cut -d= -f2)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultdp01 <<< "$(grep "defaultdp01=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultwp01 <<< "$(grep "defaultwp01=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultmp01 <<< "$(grep "defaultmp01=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultyp01 <<< "$(grep "defaultyp01=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultdp02 <<< "$(grep "defaultdp02=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultwp02 <<< "$(grep "defaultwp02=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultmp02 <<< "$(grep "defaultmp02=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultyp02 <<< "$(grep "defaultyp02=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultdp04 <<< "$(grep "defaultdp04=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultwp04 <<< "$(grep "defaultwp04=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultmp04 <<< "$(grep "defaultmp04=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultyp04 <<< "$(grep "defaultyp04=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultdp05 <<< "$(grep "defaultdp05=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultwp05 <<< "$(grep "defaultwp05=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultmp05 <<< "$(grep "defaultmp05=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultyp05 <<< "$(grep "defaultyp05=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultdp11 <<< "$(grep "defaultdp11=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultwp11 <<< "$(grep "defaultwp11=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultmp11 <<< "$(grep "defaultmp11=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultyp11 <<< "$(grep "defaultyp11=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultdp12 <<< "$(grep "defaultdp12=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultwp12 <<< "$(grep "defaultwp12=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultmp12 <<< "$(grep "defaultmp12=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  IFS=" " read -r -a defaultyp12 <<< "$(grep "defaultyp12=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentdp01 <<< "$(grep "currentdp01=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentdp01[1]}" ]; then
 | 
				
			||||||
 | 
					    currentdp01=${defaultdp01[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentwp01 <<< "$(grep "currentwp01=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentwp01[1]}" ]; then
 | 
				
			||||||
 | 
					    currentwp01=${defaultwp01[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentmp01 <<< "$(grep "currentmp01=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentmp01[1]}" ]; then
 | 
				
			||||||
 | 
					    currentmp01=${defaultmp01[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentyp01 <<< "$(grep "currentyp01=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentyp01[1]}" ]; then
 | 
				
			||||||
 | 
					    currentyp01=${defaultyp01[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentdp02 <<< "$(grep "currentdp02=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentdp02[1]}" ]; then
 | 
				
			||||||
 | 
					    currentdp02=${defaultdp02[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentwp02 <<< "$(grep "currentwp02=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentwp02[1]}" ]; then
 | 
				
			||||||
 | 
					    currentwp02=${defaultwp02[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentmp02 <<< "$(grep "currentmp02=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentmp02[1]}" ]; then
 | 
				
			||||||
 | 
					    currentmp02=${defaultmp02[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentyp02 <<< "$(grep "currentyp02=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentyp02[1]}" ]; then
 | 
				
			||||||
 | 
					    currentyp02=${defaultyp02[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentdp04 <<< "$(grep "currentdp04=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentdp04[1]}" ]; then
 | 
				
			||||||
 | 
					    currentdp04=${defaultdp04[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentwp04 <<< "$(grep "currentwp04=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentwp04[1]}" ]; then
 | 
				
			||||||
 | 
					    currentwp04=${defaultwp04[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentmp04 <<< "$(grep "currentmp04=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentmp04[1]}" ]; then
 | 
				
			||||||
 | 
					    currentmp04=${defaultmp04[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentyp04 <<< "$(grep "currentyp04=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentyp04[1]}" ]; then
 | 
				
			||||||
 | 
					    currentyp04=${defaultyp04[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentdp05 <<< "$(grep "currentdp05=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentdp05[1]}" ]; then
 | 
				
			||||||
 | 
					    currentdp05=${defaultdp05[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentwp05 <<< "$(grep "currentwp05=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentwp05[1]}" ]; then
 | 
				
			||||||
 | 
					    currentwp05=${defaultwp05[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentmp05 <<< "$(grep "currentmp05=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentmp05[1]}" ]; then
 | 
				
			||||||
 | 
					    currentmp05=${defaultmp05[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentyp05 <<< "$(grep "currentyp05=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentyp05[1]}" ]; then
 | 
				
			||||||
 | 
					    currentyp05=${defaultyp05[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentdp11 <<< "$(grep "currentdp11=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentdp11[1]}" ]; then
 | 
				
			||||||
 | 
					    currentdp11=${defaultdp11[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentwp11 <<< "$(grep "currentwp11=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentwp11[1]}" ]; then
 | 
				
			||||||
 | 
					    currentwp11=${defaultwp11[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentmp11 <<< "$(grep "currentmp11=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentmp11[1]}" ]; then
 | 
				
			||||||
 | 
					    currentmp11=${defaultmp11[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentyp11 <<< "$(grep "currentyp11=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentyp11[1]}" ]; then
 | 
				
			||||||
 | 
					    currentyp11=${defaultyp11[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentdp12 <<< "$(grep "currentdp12=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentdp12[1]}" ]; then
 | 
				
			||||||
 | 
					    currentdp12=${defaultdp12[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentwp12 <<< "$(grep "currentwp12=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentwp12[1]}" ]; then
 | 
				
			||||||
 | 
					    currentwp12=${defaultwp12[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentmp12 <<< "$(grep "currentmp12=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentmp12[1]}" ]; then
 | 
				
			||||||
 | 
					    currentmp12=${defaultmp12[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  IFS=" " read -r -a currentyp12 <<< "$(grep "currentyp12=" "${conf}" | cut -d= -f2)"
 | 
				
			||||||
 | 
					  if [ -z "${currentyp12[1]}" ]; then
 | 
				
			||||||
 | 
					    currentyp12=${defaultyp12[*]}
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					# Writing changes to configuration file.
 | 
				
			||||||
 | 
					# Globals:
 | 
				
			||||||
 | 
					#   conf
 | 
				
			||||||
 | 
					#   when
 | 
				
			||||||
 | 
					#   vidnamesarray
 | 
				
			||||||
 | 
					#   vidlinksarray
 | 
				
			||||||
 | 
					# Arguments:
 | 
				
			||||||
 | 
					#   None
 | 
				
			||||||
 | 
					#######################################
 | 
				
			||||||
 | 
					setconfig() {
 | 
				
			||||||
 | 
					  if [ -z "${when}" ] || [ "${when}" == "-d" ]; then
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[0]}" ] && [ -n "${vidlinksarray[0]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentdp01=' "${conf}")#currentdp01=${vidnamesarray[0]} ${vidlinksarray[0]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[1]}" ] && [ -n "${vidlinksarray[1]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentdp02=' "${conf}")#currentdp02=${vidnamesarray[1]} ${vidlinksarray[1]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[2]}" ] && [ -n "${vidlinksarray[2]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentdp04=' "${conf}")#currentdp04=${vidnamesarray[2]} ${vidlinksarray[2]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[3]}" ] && [ -n "${vidlinksarray[3]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentdp05=' "${conf}")#currentdp05=${vidnamesarray[3]} ${vidlinksarray[3]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[4]}" ] && [ -n "${vidlinksarray[4]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentdp11=' "${conf}")#currentdp11=${vidnamesarray[4]} ${vidlinksarray[4]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[5]}" ] && [ -n "${vidlinksarray[5]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentdp12=' "${conf}")#currentdp12=${vidnamesarray[5]} ${vidlinksarray[5]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  if [ "${when}" == "-w" ]; then
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[0]}" ] && [ -n "${vidlinksarray[0]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentwp01=' "${conf}")#currentwp01=${vidnamesarray[0]} ${vidlinksarray[0]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[1]}" ] && [ -n "${vidlinksarray[1]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentwp02=' "${conf}")#currentwp02=${vidnamesarray[1]} ${vidlinksarray[1]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[2]}" ] && [ -n "${vidlinksarray[2]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentwp04=' "${conf}")#currentwp04=${vidnamesarray[2]} ${vidlinksarray[2]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[3]}" ] && [ -n "${vidlinksarray[3]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentwp05=' "${conf}")#currentwp05=${vidnamesarray[3]} ${vidlinksarray[3]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[4]}" ] && [ -n "${vidlinksarray[4]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentwp11=' "${conf}")#currentwp11=${vidnamesarray[4]} ${vidlinksarray[4]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[5]}" ] && [ -n "${vidlinksarray[5]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentwp12=' "${conf}")#currentwp12=${vidnamesarray[5]} ${vidlinksarray[5]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  if [ "${when}" == "-m" ]; then
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[0]}" ] && [ -n "${vidlinksarray[0]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentmp01=' "${conf}")#currentmp01=${vidnamesarray[0]} ${vidlinksarray[0]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[1]}" ] && [ -n "${vidlinksarray[1]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentmp02=' "${conf}")#currentmp02=${vidnamesarray[1]} ${vidlinksarray[1]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[2]}" ] && [ -n "${vidlinksarray[2]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentmp04=' "${conf}")#currentmp04=${vidnamesarray[2]} ${vidlinksarray[2]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[3]}" ] && [ -n "${vidlinksarray[3]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentmp05=' "${conf}")#currentmp05=${vidnamesarray[3]} ${vidlinksarray[3]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[4]}" ] && [ -n "${vidlinksarray[4]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentmp11=' "${conf}")#currentmp11=${vidnamesarray[4]} ${vidlinksarray[4]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[5]}" ] && [ -n "${vidlinksarray[5]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentmp12=' "${conf}")#currentmp12=${vidnamesarray[5]} ${vidlinksarray[5]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  if [ "${when}" == "-y" ]; then
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[0]}" ] && [ -n "${vidlinksarray[0]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentyp01=' "${conf}")#currentyp01=${vidnamesarray[0]} ${vidlinksarray[0]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[1]}" ] && [ -n "${vidlinksarray[1]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentyp02=' "${conf}")#currentyp02=${vidnamesarray[1]} ${vidlinksarray[1]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[2]}" ] && [ -n "${vidlinksarray[2]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentyp04=' "${conf}")#currentyp04=${vidnamesarray[2]} ${vidlinksarray[2]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[3]}" ] && [ -n "${vidlinksarray[3]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentyp05=' "${conf}")#currentyp05=${vidnamesarray[3]} ${vidlinksarray[3]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[4]}" ] && [ -n "${vidlinksarray[4]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentyp11=' "${conf}")#currentyp11=${vidnamesarray[4]} ${vidlinksarray[4]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -n "${vidnamesarray[5]}" ] && [ -n "${vidlinksarray[5]}" ]; then
 | 
				
			||||||
 | 
					      sed -i "s#$(grep 'currentyp12=' "${conf}")#currentyp12=${vidnamesarray[5]} ${vidlinksarray[5]}#" "${conf}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# VARIABLES:
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					show=$1
 | 
				
			||||||
 | 
					conf=$2
 | 
				
			||||||
 | 
					if [ -z "${conf}" ] || [ "${conf}" == "-" ]; then
 | 
				
			||||||
 | 
					  conf="$(dirname "$(realpath "$0")")/$(basename -s .sh "$0").conf"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					ever=$4
 | 
				
			||||||
 | 
					if [ -z "${ever}" ] || [ "${ever}" == "-" ]; then
 | 
				
			||||||
 | 
					  ever=1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if grep -q -o "^[0-9][0-9]*$" <<< "${ever}"; then
 | 
				
			||||||
 | 
					  :
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					  execerror "${ever} - wrong argument"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					when=$3
 | 
				
			||||||
 | 
					if [ -z "${when}" ]; then
 | 
				
			||||||
 | 
					  viddate=$(date +"%Y").$(date +"%m").$(date +"%d")
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if [ "${when}" == "-d" ]; then
 | 
				
			||||||
 | 
					  d=$(date -d "-${ever} day" +"%d")
 | 
				
			||||||
 | 
					  m=$(date +"%m")
 | 
				
			||||||
 | 
					  if [ "$(date -d "-${ever} day" +'%m')" != "$(date +'%m')" ]; then
 | 
				
			||||||
 | 
					    m=$(date -d "-${ever} day" +'%m')
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  y=$(date +"%Y")
 | 
				
			||||||
 | 
					  if [ "$(date -d "-${ever} day" +'%Y')" != "$(date +'%Y')" ]; then
 | 
				
			||||||
 | 
					    y=$(date -d "-${ever} day" +'%Y')
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  viddate="${y}.${m}.${d}"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if [ "${when}" == "-w" ]; then
 | 
				
			||||||
 | 
					  w=$(date -d "-${ever} week" +"%V")
 | 
				
			||||||
 | 
					  y=$(date +"%Y")
 | 
				
			||||||
 | 
					  if [ "$(date -d "-${ever} week" +'%Y')" != "$(date +'%Y')" ]; then
 | 
				
			||||||
 | 
					    y=$(date -d "-${ever} week" +'%Y')
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  viddate="${y}-w${w}"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if [ "${when}" == "-m" ]; then
 | 
				
			||||||
 | 
					  m=$(date -d "-${ever} month" +"%m")
 | 
				
			||||||
 | 
					  y=$(date +"%Y")
 | 
				
			||||||
 | 
					  if [ "$(date -d "-${ever} month" +'%Y')" != "$(date +'%Y')" ]; then
 | 
				
			||||||
 | 
					    y=$(date -d "-${ever} month" +'%Y')
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  viddate="${y}.${m}"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if [ "${when}" == "-y" ]; then
 | 
				
			||||||
 | 
					  y=$(date -d "-${ever} year" +"%Y")
 | 
				
			||||||
 | 
					  viddate="${y}"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					vidname="${viddate}.mp4"
 | 
				
			||||||
 | 
					only=$5
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					time=$(date +%s)
 | 
				
			||||||
 | 
					cd "$(dirname "$(realpath "$0")")" || execerror
 | 
				
			||||||
 | 
					if [ ! -e "${conf}" ]; then
 | 
				
			||||||
 | 
					  execerror "Not found config file: ${conf}"
 | 
				
			||||||
 | 
					else
 | 
				
			||||||
 | 
					  getconfig
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if [ -z "${logs}" ]; then
 | 
				
			||||||
 | 
					  logs=/dev/null
 | 
				
			||||||
 | 
					elif [ ! -e "${logs}" ]; then
 | 
				
			||||||
 | 
					  touch "${logs}"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					if ! command -v curl &> /dev/null || \
 | 
				
			||||||
 | 
					  ! command -v ffmpeg &> /dev/null || \
 | 
				
			||||||
 | 
					  ! command -v xmllint &> /dev/null || \
 | 
				
			||||||
 | 
					  ! command -v jq &> /dev/null; then
 | 
				
			||||||
 | 
					  execerror "Not found dependencies"
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# MAIN:
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vidpathsarray=()
 | 
				
			||||||
 | 
					vidlinksarray=()
 | 
				
			||||||
 | 
					vidtgidsarray=()
 | 
				
			||||||
 | 
					vidtgcpsarray=()
 | 
				
			||||||
 | 
					for name in "${vidnamesarray[@]}"; do
 | 
				
			||||||
 | 
					  vidmatch="${name}_${vidname}"
 | 
				
			||||||
 | 
					  while read -r FILE; do
 | 
				
			||||||
 | 
					    vidpathsarray+=("${FILE}")
 | 
				
			||||||
 | 
					  done < <(find "${pathroot}" -name "*${vidmatch}" | sort)
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					for item in "${!vidpathsarray[@]}"; do
 | 
				
			||||||
 | 
					  # WORDPRESS UPLOAD VIDEO
 | 
				
			||||||
 | 
					  if [ ! "$only" == "--onlytg" ]; then
 | 
				
			||||||
 | 
					    # This realisation isn't optimal, but it fixes a few issues with large files:
 | 
				
			||||||
 | 
					    #    variable=$(base64 $file)                      -> "xrealloc: cannot allocate"
 | 
				
			||||||
 | 
					    #    response=$(curl -X POST -d @${file}.xml $url) -> "curl: option -d: out of memory"
 | 
				
			||||||
 | 
					    filetype="video/mp4"
 | 
				
			||||||
 | 
					    echo '<?xml version="1.0"?>
 | 
				
			||||||
 | 
					    <methodCall><methodName>wp.uploadFile</methodName>
 | 
				
			||||||
 | 
					    <params>
 | 
				
			||||||
 | 
					    <param><value>1</value></param>
 | 
				
			||||||
 | 
					    <param><value>'"${wpxmlrpcuser}"'</value></param>
 | 
				
			||||||
 | 
					    <param><value>'"${wpxmlrpcpass}"'</value></param>
 | 
				
			||||||
 | 
					    <param><value><struct>
 | 
				
			||||||
 | 
					    <member><name>name</name><value><string>'"$(basename "${vidpathsarray[$item]}")"'</string></value></member>
 | 
				
			||||||
 | 
					    <member><name>type</name><value><string>'"${filetype}"'</string></value></member>
 | 
				
			||||||
 | 
					    <member><name>bits</name><value><base64>' > "${vidpathsarray[$item]}.xml"
 | 
				
			||||||
 | 
					    base64 --wrap=0 "${vidpathsarray[$item]}" >> "${vidpathsarray[$item]}.xml"
 | 
				
			||||||
 | 
					    echo '</base64></value></member>
 | 
				
			||||||
 | 
					    </struct></value></param>
 | 
				
			||||||
 | 
					    </params>
 | 
				
			||||||
 | 
					    </methodCall>' >> "${vidpathsarray[$item]}.xml"
 | 
				
			||||||
 | 
					    response="${vidpathsarray[$item]}-response.xml"
 | 
				
			||||||
 | 
					    if curl -X POST -T "${vidpathsarray[$item]}.xml" "${wpxmlrpclink}" > "${response}"; then
 | 
				
			||||||
 | 
					      vidlinksarray+=("$(xmllint --xpath '//member[contains(name,"link")]/value/string/text()' "${response}")")
 | 
				
			||||||
 | 
					      vidlinkcodeis=$(curl --output /dev/null --silent --write-out "%{http_code}" "${vidlinksarray[$item]}")
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      execerror "${response}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [[ ${vidlinkcodeis} -eq 200 ]]; then
 | 
				
			||||||
 | 
					      rm "${vidpathsarray[$item]}.xml"
 | 
				
			||||||
 | 
					      rm "${response}"
 | 
				
			||||||
 | 
					      echo "$(date +'%Y.%m.%d-%H:%M:%S') sent ${vidpathsarray[$item]} to ${vidlinksarray[$item]}" | tee -a "${logs}"
 | 
				
			||||||
 | 
					      echo -e "WORDPRESS UPLOAD VIDEO RESULT:"
 | 
				
			||||||
 | 
					      echo -e "item: ${item}"
 | 
				
			||||||
 | 
					      echo -e "type: ${filetype}"
 | 
				
			||||||
 | 
					      echo -e "name: ${vidnamesarray[$item]}"
 | 
				
			||||||
 | 
					      echo -e "base: $(basename "${vidpathsarray[$item]}")"
 | 
				
			||||||
 | 
					      echo -e "path: ${vidpathsarray[$item]}"
 | 
				
			||||||
 | 
					      echo -e "link: ${vidlinksarray[$item]}"
 | 
				
			||||||
 | 
					      echo -e "code: ${vidlinkcodeis}"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      vidlinksarray[item]=''
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # TELEGRAM SEND/UPLOAD VIDEO
 | 
				
			||||||
 | 
					  if [ ! "${only}" == "--onlywp" ]; then
 | 
				
			||||||
 | 
					    videofullpath=${vidpathsarray[$item]}
 | 
				
			||||||
 | 
					    vidcompressed=${videofullpath//".mp4"/"-compressed.mp4"}
 | 
				
			||||||
 | 
					    if [ -n "$(find "${videofullpath}" -prune -size +51380224c)" ]; then
 | 
				
			||||||
 | 
					      duration=$(ffprobe -i "${videofullpath}" \
 | 
				
			||||||
 | 
					        -show_entries format=duration -v quiet -of csv="p=0" | cut -d'.' -f 1)
 | 
				
			||||||
 | 
					      if ffmpeg -i "${videofullpath}" \
 | 
				
			||||||
 | 
					        -c:v libx264 -b:v "$((49*8*1000/duration))k" \
 | 
				
			||||||
 | 
					        -vf "scale=960:540,fps=25,format=yuv420p" \
 | 
				
			||||||
 | 
					        -preset veryslow "${vidcompressed}" -y -loglevel quiet -stats; then
 | 
				
			||||||
 | 
					        videofullpath=${vidcompressed}
 | 
				
			||||||
 | 
					      else
 | 
				
			||||||
 | 
					        execerror "ffmpeg convert ${videofullpath} to ${vidcompressed}"
 | 
				
			||||||
 | 
					      fi
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    videobasename=$(basename "${videofullpath}")
 | 
				
			||||||
 | 
					    videobasename=${videobasename//".mp4"/""}
 | 
				
			||||||
 | 
					    response=$(curl -s \
 | 
				
			||||||
 | 
					      -F "chat_id=${telegramchatid}" \
 | 
				
			||||||
 | 
					      -F "video=@${videofullpath}" \
 | 
				
			||||||
 | 
					      -F "caption=${videobasename}" \
 | 
				
			||||||
 | 
					      "${telegramapiurl}/sendVideo")
 | 
				
			||||||
 | 
					    if curl -s -F "chat_id=${telegramchatid}" \
 | 
				
			||||||
 | 
					      -F "message_id=$(echo "${response}" | jq -r '.result.message_id')" \
 | 
				
			||||||
 | 
					      "${telegramapiurl}/deleteMessage"; then
 | 
				
			||||||
 | 
					      vidtgidsarray+=("$(echo "${response}" | jq -r '.result.video.file_id')")
 | 
				
			||||||
 | 
					      vidtgcpsarray+=("$(echo "${response}" | jq -r '.result.caption')")
 | 
				
			||||||
 | 
					      addtologs "sent ${videofullpath} to ${vidtgidsarray[$item]} Telegram file ID"
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      execerror "sent ${videofullpath} to ${telegramchatid} Telegram Chat ID"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					    if [ -e "${vidcompressed}" ]; then
 | 
				
			||||||
 | 
					      rm "${vidcompressed}"
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# TELEGRAM SEND MEDIAGROUP
 | 
				
			||||||
 | 
					if [ ! "${only}" == "--onlywp" ]; then
 | 
				
			||||||
 | 
					  response=$(curl -s -F "chat_id=${telegramchatid}" \
 | 
				
			||||||
 | 
					    -F media='[
 | 
				
			||||||
 | 
					      {"type":"photo","media":"'"${tgpreviewlink}"'",
 | 
				
			||||||
 | 
					       "caption":"period: '"${viddate}"'\nsource: '"${tgpreviewtext}"'\nstream: '"${youtubelink}"'"},
 | 
				
			||||||
 | 
					      {"type":"video","media":"'"${vidtgidsarray[0]}"'"},
 | 
				
			||||||
 | 
					      {"type":"video","media":"'"${vidtgidsarray[1]}"'"},
 | 
				
			||||||
 | 
					      {"type":"video","media":"'"${vidtgidsarray[2]}"'"},
 | 
				
			||||||
 | 
					      {"type":"video","media":"'"${vidtgidsarray[3]}"'"},
 | 
				
			||||||
 | 
					      {"type":"video","media":"'"${vidtgidsarray[4]}"'"},
 | 
				
			||||||
 | 
					      {"type":"video","media":"'"${vidtgidsarray[5]}"'"}]' \
 | 
				
			||||||
 | 
					    -H "Content-Type:multipart/form-data" \
 | 
				
			||||||
 | 
					    "${telegramapiurl}/sendMediaGroup")
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# WORDPRESS UPDATE PAGE
 | 
				
			||||||
 | 
					if [ ! "${only}" == "--onlytg" ]; then
 | 
				
			||||||
 | 
					  setconfig
 | 
				
			||||||
 | 
					  getconfig
 | 
				
			||||||
 | 
					  xml=$(cat "./${wptemplateis}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  xml=${xml//wpeditpageid/${wpeditpageid}}
 | 
				
			||||||
 | 
					  xml=${xml//wpxmlrpcuser/${wpxmlrpcuser}}
 | 
				
			||||||
 | 
					  xml=${xml//wpxmlrpcpass/${wpxmlrpcpass}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  xml=${xml//youtubelink/${youtubelink}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp01[0]"/${currentdp01[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp01[1]"/${currentdp01[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp02[0]"/${currentdp02[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp02[1]"/${currentdp02[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp04[0]"/${currentdp04[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp04[1]"/${currentdp04[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp05[0]"/${currentdp05[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp05[1]"/${currentdp05[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp11[0]"/${currentdp11[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp11[1]"/${currentdp11[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp12[0]"/${currentdp12[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentdp12[1]"/${currentdp12[1]}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp01[0]"/${currentwp01[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp01[1]"/${currentwp01[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp02[0]"/${currentwp02[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp02[1]"/${currentwp02[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp04[0]"/${currentwp04[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp04[1]"/${currentwp04[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp05[0]"/${currentwp05[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp05[1]"/${currentwp05[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp11[0]"/${currentwp11[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp11[1]"/${currentwp11[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp12[0]"/${currentwp12[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentwp12[1]"/${currentwp12[1]}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp01[0]"/${currentmp01[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp01[1]"/${currentmp01[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp02[0]"/${currentmp02[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp02[1]"/${currentmp02[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp04[0]"/${currentmp04[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp04[1]"/${currentmp04[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp05[0]"/${currentmp05[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp05[1]"/${currentmp05[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp11[0]"/${currentmp11[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp11[1]"/${currentmp11[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp12[0]"/${currentmp12[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentmp12[1]"/${currentmp12[1]}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp01[0]"/${currentyp01[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp01[1]"/${currentyp01[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp02[0]"/${currentyp02[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp02[1]"/${currentyp02[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp04[0]"/${currentyp04[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp04[1]"/${currentyp04[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp05[0]"/${currentyp05[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp05[1]"/${currentyp05[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp11[0]"/${currentyp11[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp11[1]"/${currentyp11[1]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp12[0]"/${currentyp12[0]}}
 | 
				
			||||||
 | 
					  xml=${xml//"currentyp12[1]"/${currentyp12[1]}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  xml=${xml//wpedituserid/${wpedituserid}}
 | 
				
			||||||
 | 
					  xml=${xml//wppageauthor/${wppageauthor}}
 | 
				
			||||||
 | 
					  xml=${xml//wppagelinkis/${wppagelinkis}}
 | 
				
			||||||
 | 
					  xml=${xml//wpeditdateis/${wpeditdateis}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  response=$(curl -d "${xml}" "${wpxmlrpclink}")
 | 
				
			||||||
 | 
					  if echo "${response}" | grep -q '<boolean>1</boolean>'; then
 | 
				
			||||||
 | 
					    addtologs "update $(grep 'Link' "${xml}" | cut -d'>' -f 6 | cut -d'<' -f 1))"
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    echo "${response}" | xmllint --format - > "${pathroot}/wp-page${wpeditpageid}-response.xml" 2>/dev/null
 | 
				
			||||||
 | 
					    execerror "${pathroot}/wp-page${wpeditpageid}-response.xml"
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					execquite
 | 
				
			||||||
| 
						 | 
					@ -15,21 +15,37 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[enable-broadcast]
 | 
					[enable-broadcast]
 | 
				
			||||||
# List the broadcast block names. Only blocks with the TRUE value will be used.
 | 
					# List the broadcast block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
camera.test.local = true
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[enable-sequences]
 | 
					[enable-sequences]
 | 
				
			||||||
# List the sequence/camera block names. Only blocks with the TRUE value will be used.
 | 
					# List the sequence camera block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
camera.test.local = true
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[enable-sensors]
 | 
					[enable-sensors]
 | 
				
			||||||
# List the sensor block names. Only blocks with the TRUE value will be used.
 | 
					# List the sensor block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
sensor.test.local = true
 | 
					sensor.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-convert]
 | 
				
			||||||
 | 
					# List the convert block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[enable-publish]
 | 
				
			||||||
 | 
					# List the publish block names. Only blocks with the TRUE value will be used.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					camera.test.local = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[broadcast-config:camera.test.local]
 | 
					[broadcast-config:camera.test.local]
 | 
				
			||||||
# Broadcast parameter description block always starts with "broadcast-config:".
 | 
					# Broadcast parameter description block always starts with "broadcast-config:".
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
src = rtsp://user:pass@192.168.254.253:554/Streaming/Channels/101,http://radio.fm:8000/stream.mp3
 | 
					src = rtsp://user:pass@192.168.254.253:554/Streaming/Channels/101,http://radio.fm:8000/stream.mp3
 | 
				
			||||||
dst = rtp://239.0.0.1:5554
 | 
					dst = rtp://239.0.0.1:5554
 | 
				
			||||||
# Optionality you can change video stream framerate.
 | 
					# Optionality you can change video stream framerate.
 | 
				
			||||||
| 
						 | 
					@ -56,9 +72,11 @@ dst = rtp://239.0.0.1:5554
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[sensor-config:sensor.test.local]
 | 
					[sensor-config:sensor.test.local]
 | 
				
			||||||
# Remote host's sensor parameter description block always starts with "sensor-config:".
 | 
					# Remote host's sensor parameter description block always starts with "sensor-config:".
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
hostname = 192.168.254.252
 | 
					hostname = 192.168.254.252
 | 
				
			||||||
username = user
 | 
					username = user
 | 
				
			||||||
userpass = pass
 | 
					userpass = pass
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
# To recognize options for polling a sensor, you must specify the type of sensor.
 | 
					# To recognize options for polling a sensor, you must specify the type of sensor.
 | 
				
			||||||
# Supported types:
 | 
					# Supported types:
 | 
				
			||||||
#   ds18b20
 | 
					#   ds18b20
 | 
				
			||||||
| 
						 | 
					@ -68,19 +86,38 @@ nodename = 28-1a2b3c4d5e6f
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[camera-config:camera.test.local]
 | 
					[camera-config:camera.test.local]
 | 
				
			||||||
# Camera parameter description block always starts with "camera-config:".
 | 
					# Camera parameter description block always starts with "camera-config:".
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
hostname = 192.168.254.253
 | 
					hostname = 192.168.254.253
 | 
				
			||||||
username = user
 | 
					username = user
 | 
				
			||||||
userpass = pass
 | 
					userpass = pass
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
# If a record directory on a remote host is used, a username and password must be specified.
 | 
					# If a record directory on a remote host is used, a username and password must be specified.
 | 
				
			||||||
# Supported protocols:
 | 
					# Supported protocols:
 | 
				
			||||||
#   FTP, SFTP.
 | 
					#   FTP, SFTP, SMB or local path.
 | 
				
			||||||
records_root_path = ftp://192.168.254.254/Records/camera.test.local
 | 
					records_root_path = ftp://user:pass@192.168.254.254:21/Records/camera.test.local
 | 
				
			||||||
records_root_user = user
 | 
					#
 | 
				
			||||||
records_root_pass = pass
 | 
					# One line parameters string has lower priority and parameters are overwritten by
 | 
				
			||||||
 | 
					# separated parameter variables if you use both.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#records_root_path = /Records/camera.test.local
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#records_root_host = 192.168.254.254
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Optionality you can set custom connection port:
 | 
				
			||||||
 | 
					#records_root_port = 21
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# You must set connection type (ftp is faster than sftp, sftp is faster than smb):
 | 
				
			||||||
 | 
					#   ftp, sftp, smb.
 | 
				
			||||||
 | 
					#records_root_type = ftp
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#records_root_user = user
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#records_root_pass = pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
[camera-sequences:camera.test.local]
 | 
					[camera-sequences:camera.test.local]
 | 
				
			||||||
# Camera sequence description block always starts with "camera-sequences:".
 | 
					# Camera sequence description block always starts with "camera-sequences:".
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
# Place only the sequence of PTZ-actions in this block!
 | 
					# Place only the sequence of PTZ-actions in this block!
 | 
				
			||||||
# Variable name can be anything. Only 'downloadjpeg' is using this for filename prefix.
 | 
					# Variable name can be anything. Only 'downloadjpeg' is using this for filename prefix.
 | 
				
			||||||
# Available actions: 
 | 
					# Available actions: 
 | 
				
			||||||
| 
						 | 
					@ -108,5 +145,99 @@ step051 = setposashome,       -,       -,       -,       -,       -,       -,
 | 
				
			||||||
step061 = settextonosd,       0,       0,       -,       -,       -,       -,       3,   hello, 'x|y: osd text position, text: text for osd without quotes or commas'
 | 
					step061 = settextonosd,       0,       0,       -,       -,       -,       -,       3,   hello, 'x|y: osd text position, text: text for osd without quotes or commas'
 | 
				
			||||||
step062 = settextonosd,       0,       0,       -,       -,       -,       -,       3, sensor-config:sensor.test.local, 'if a sensor configuration is specified, the sensor value is used instead of text'
 | 
					step062 = settextonosd,       0,       0,       -,       -,       -,       -,       3, sensor-config:sensor.test.local, 'if a sensor configuration is specified, the sensor value is used instead of text'
 | 
				
			||||||
step063 = settextonosd,       0,       0,       -,       -,       -,       -,       3,        , 'an empty text value is used to clear the osd'
 | 
					step063 = settextonosd,       0,       0,       -,       -,       -,       -,       3,        , 'an empty text value is used to clear the osd'
 | 
				
			||||||
step071 = downloadjpeg,    1280,     720,       -,       -,       -,       -,       5,        , 'name: filename prefix, x|y: camera width|height resolution'
 | 
					step071 = downloadjpeg,    1920,    1080,       -,       -,       -,       -,       5,        , 'name: filename prefix, x|y: camera width|height resolution'
 | 
				
			||||||
step999 = rebootcamera,       -,       -,       -,       -,       -,       -,     120,        ,
 | 
					step999 = rebootcamera,       -,       -,       -,       -,       -,       -,     120,        ,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[convert-config:camera.test.local]
 | 
				
			||||||
 | 
					# Converter parameter description block always starts with "convert-config:".
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					image_find_names = step071, image-01, image-02
 | 
				
			||||||
 | 
					# If image root or destination video directories on a remote host is used, username and password must be specified.
 | 
				
			||||||
 | 
					# Supported protocols:
 | 
				
			||||||
 | 
					#   FTP, SFTP, SMB or local path.
 | 
				
			||||||
 | 
					image_root_path = sftp://user:pass@192.168.254.254/Records/camera.test.local
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# One line parameters string has lower priority and parameters are overwritten by
 | 
				
			||||||
 | 
					# separated parameter variables if you use both.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#image_root_path = /Records/camera.test.local
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#image_root_host = 192.168.254.254
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Optionality you can set custom connection port:
 | 
				
			||||||
 | 
					#image_root_port = 22
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# You must set connection type (ftp is faster than sftp, sftp is faster than smb):
 | 
				
			||||||
 | 
					#   ftp, sftp, smb.
 | 
				
			||||||
 | 
					#image_root_type = sftp
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#image_root_user = user
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#image_root_pass = pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					video_dest_path = smb://user:pass@192.168.254.254/Downloads
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# One line parameters string has lower priority and parameters are overwritten by
 | 
				
			||||||
 | 
					# separated parameter variables if you use both.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#video_dest_path = /Downloads
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Optionality you can set custom connection port:
 | 
				
			||||||
 | 
					#video_dest_host = 192.168.254.254
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#video_dest_port = 445
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# You must set connection type (ftp is faster than sftp, sftp is faster than smb):
 | 
				
			||||||
 | 
					#   ftp, sftp, smb.
 | 
				
			||||||
 | 
					#video_dest_type = smb
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#video_dest_user = user
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#video_dest_pass = pass
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					video_scale_x = 1920
 | 
				
			||||||
 | 
					video_scale_y = 1080
 | 
				
			||||||
 | 
					video_framerate = 25
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[publish-config:camera.test.local]
 | 
				
			||||||
 | 
					# Publisher parameter description block always starts with "publish-config:".
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					video_find_names = step071, image-01, image-02
 | 
				
			||||||
 | 
					# If a video directory on a remote host is used, a username and password must be specified.
 | 
				
			||||||
 | 
					# Supported protocols:
 | 
				
			||||||
 | 
					#   FTP, SFTP, SMB or local path.
 | 
				
			||||||
 | 
					video_root_path = /home/user/Downloads
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# One line parameters string has lower priority and parameters are overwritten by
 | 
				
			||||||
 | 
					# separated parameter variables if you use both.
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#video_dest_path = /home/user/Downloads
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#video_dest_host =
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Optionality you can set custom connection port:
 | 
				
			||||||
 | 
					#video_dest_port =
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# You must set connection type (ftp is faster than sftp, sftp is faster than smb):
 | 
				
			||||||
 | 
					#   ftp, sftp, smb.
 | 
				
			||||||
 | 
					#video_dest_type =
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#video_dest_user =
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					#video_dest_pass =
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Optionality you can enable or disable publishing by Wordpress:
 | 
				
			||||||
 | 
					#   true - Wordpress enabled, false - Wordpress disbaled.
 | 
				
			||||||
 | 
					wp_enabled = true
 | 
				
			||||||
 | 
					wp_site_name = www.site.name
 | 
				
			||||||
 | 
					wp_user_name = user
 | 
				
			||||||
 | 
					wp_user_pass = pass
 | 
				
			||||||
 | 
					wp_update_page_id = 4848 
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Optionality you can enable or disable publishing by Telegram:
 | 
				
			||||||
 | 
					#   true - Wordpress enabled, false - Telegram disbaled.
 | 
				
			||||||
 | 
					tg_enabled = true
 | 
				
			||||||
 | 
					tg_api_key = TELEGRAM_API_KEY
 | 
				
			||||||
 | 
					tg_chat_id = @blackhole
 | 
				
			||||||
							
								
								
									
										4937
									
								
								cctv-scheduler.py
									
									
									
									
									
								
							
							
						
						
									
										4937
									
								
								cctv-scheduler.py
									
									
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								info/images/cctv-scheduler-0.4.png
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								info/images/cctv-scheduler-0.4.png
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 360 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								info/images/cctv-scheduler-0.5.png
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								info/images/cctv-scheduler-0.5.png
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 348 KiB  | 
		Loading…
	
		Reference in New Issue
	
	Block a user