add stream url to hook data
This commit is contained in:
parent
03888f629e
commit
52ddd2569d
4
DOCS.md
4
DOCS.md
|
@ -61,6 +61,7 @@ Data is passed to hooks in the form of environment variables. The main variable
|
|||
* `VIDEO_UPLOADER` - streamer's account name, as shown on the target platform
|
||||
* `VIDEO_UPLOADER_ID` - streamer's account id
|
||||
* `VIDEO_FILENAME` - expected output file name
|
||||
* `VIDEO_URL` - link to the stream
|
||||
* `VIDEO_PLATFORM` - `twitch` or `youtube`
|
||||
|
||||
### Download Fail / `DOWNLOAD_FAIL`
|
||||
|
@ -71,6 +72,7 @@ Data is passed to hooks in the form of environment variables. The main variable
|
|||
* `VIDEO_UPLOADER` - streamer's account name, as shown on the target platform
|
||||
* `VIDEO_UPLOADER_ID` - streamer's account id
|
||||
* `VIDEO_FILENAME` - expected output file name
|
||||
* `VIDEO_URL` - link to the stream
|
||||
* `VIDEO_PLATFORM` - `twitch` or `youtube`
|
||||
|
||||
### Download Retry / `DOWNLOAD_RETRY`
|
||||
|
@ -81,6 +83,7 @@ Data is passed to hooks in the form of environment variables. The main variable
|
|||
* `VIDEO_UPLOADER` - streamer's account name, as shown on the target platform
|
||||
* `VIDEO_UPLOADER_ID` - streamer's account id
|
||||
* `VIDEO_FILENAME` - expected output file name
|
||||
* `VIDEO_URL` - link to the stream
|
||||
* `VIDEO_PLATFORM` - `twitch` or `youtube`
|
||||
|
||||
### Download Metadata Fail / `DOWNLOAD_META_FAIL`
|
||||
|
@ -96,6 +99,7 @@ Data is passed to hooks in the form of environment variables. The main variable
|
|||
* `VIDEO_UPLOADER` - streamer's account name, as shown on the target platform
|
||||
* `VIDEO_UPLOADER_ID` - streamer's account id
|
||||
* `VIDEO_FILENAME` - expected output file name
|
||||
* `VIDEO_URL` - link to the stream
|
||||
* `VIDEO_PLATFORM` - `twitch` or `youtube`
|
||||
* `FILE_FULLPATH` - full path to the saved file
|
||||
* `FILE_THUMBNAIL` - full path the the saved thumbnail
|
||||
|
|
4
hooks.go
4
hooks.go
|
@ -19,6 +19,7 @@ func onDownloadStart(meta VideoMetadata) {
|
|||
fmt.Sprintf("VIDEO_UPLOADER_ID=%s", meta.UploaderID),
|
||||
fmt.Sprintf("VIDEO_FILENAME=%s", path.Clean(meta.Filename)),
|
||||
fmt.Sprintf("VIDEO_PLATFORM=%s", meta.Platform),
|
||||
fmt.Sprintf("VIDEO_URL=%s", meta.StreamURL),
|
||||
}
|
||||
|
||||
executeHook(env, meta.UploaderID)
|
||||
|
@ -35,6 +36,7 @@ func onDownloadFail(meta VideoMetadata, message string) {
|
|||
fmt.Sprintf("VIDEO_UPLOADER_ID=%s", meta.UploaderID),
|
||||
fmt.Sprintf("VIDEO_FILENAME=%s", path.Clean(meta.Filename)),
|
||||
fmt.Sprintf("VIDEO_PLATFORM=%s", meta.Platform),
|
||||
fmt.Sprintf("VIDEO_URL=%s", meta.StreamURL),
|
||||
}
|
||||
|
||||
executeHook(env, meta.UploaderID)
|
||||
|
@ -51,6 +53,7 @@ func onDownloadRetry(meta VideoMetadata, try int) {
|
|||
fmt.Sprintf("VIDEO_UPLOADER_ID=%s", meta.UploaderID),
|
||||
fmt.Sprintf("VIDEO_FILENAME=%s", path.Clean(meta.Filename)),
|
||||
fmt.Sprintf("VIDEO_PLATFORM=%s", meta.Platform),
|
||||
fmt.Sprintf("VIDEO_URL=%s", meta.StreamURL),
|
||||
}
|
||||
|
||||
executeHook(env, meta.UploaderID)
|
||||
|
@ -80,6 +83,7 @@ func onDownloadFinish(meta VideoMetadata) {
|
|||
fmt.Sprintf("VIDEO_FILENAME=%s", meta.Filename),
|
||||
fmt.Sprintf("FILE_FULLPATH=%s", meta.FilePath),
|
||||
fmt.Sprintf("FILE_THUMBNAIL=%s", meta.ThumbnailPath),
|
||||
fmt.Sprintf("VIDEO_URL=%s", meta.StreamURL),
|
||||
}
|
||||
|
||||
executeHook(env, meta.UploaderID)
|
||||
|
|
|
@ -17,6 +17,7 @@ type VideoMetadata struct {
|
|||
UploaderID string `json:"uploader_id"`
|
||||
IsLive bool `json:"is_live"`
|
||||
Filename string `json:"filename"`
|
||||
StreamURL string `json:"webpage_url"`
|
||||
FilePath string
|
||||
ThumbnailPath string
|
||||
Platform string
|
||||
|
|
Loading…
Reference in New Issue