spacedl

package module
v0.0.0-...-b448938 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

README

space-dl

download twitter spaces

Requirement

  • FFmpeg

Installation

go install github.com/qitoi/space-dl/cmd/space-dl@latest

Usage

space-dl <space_id>

License

Apache License 2.0

Copyright 2021 qitoi

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFFmpeg

func CheckFFmpeg() error

Types

type AudioSpaceByIDFeatures

type AudioSpaceByIDFeatures struct {
	Spaces2022H2Clipping                                           bool `json:"spaces_2022_h2_clipping"`
	Spaces2022H2SpacesCommunities                                  bool `json:"spaces_2022_h2_spaces_communities"`
	ResponsiveWebTwitterBlueVerifiedBadgeIsEnabled                 bool `json:"responsive_web_twitter_blue_verified_badge_is_enabled"`
	VerifiedPhoneLabelEnabled                                      bool `json:"verified_phone_label_enabled"`
	ViewCountsPublicVisibilityEnabled                              bool `json:"view_counts_public_visibility_enabled"`
	LongformNotetweetsConsumptionEnabled                           bool `json:"longform_notetweets_consumption_enabled"`
	TweetypieUnmentionOptimizationEnabled                          bool `json:"tweetypie_unmention_optimization_enabled"`
	ResponsiveWebUcGqlEnabled                                      bool `json:"responsive_web_uc_gql_enabled"`
	VibeApiEnabled                                                 bool `json:"vibe_api_enabled"`
	ResponsiveWebEditTweetApiEnabled                               bool `json:"responsive_web_edit_tweet_api_enabled"`
	GraphqlIsTranslatableRwebTweetIsTranslatableEnabled            bool `json:"graphql_is_translatable_rweb_tweet_is_translatable_enabled"`
	ViewCountsEverywhereApiEnabled                                 bool `json:"view_counts_everywhere_api_enabled"`
	StandardizedNudgesMisinfo                                      bool `json:"standardized_nudges_misinfo"`
	TweetWithVisibilityResultsPreferGqlLimitedActionsPolicyEnabled bool `json:"tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled"`
	ResponsiveWebGraphqlTimelineNavigationEnabled                  bool `json:"responsive_web_graphql_timeline_navigation_enabled"`
	InteractiveTextEnabled                                         bool `json:"interactive_text_enabled"`
	ResponsiveWebTextConversationsEnabled                          bool `json:"responsive_web_text_conversations_enabled"`
	ResponsiveWebEnhanceCardsEnabled                               bool `json:"responsive_web_enhance_cards_enabled"`
	ResponsiveWebGraphqlExcludeDirectiveEnabled                    bool `json:"responsive_web_graphql_exclude_directive_enabled"`
	ResponsiveWebGraphqlSkipUserProfileImageExtensionsEnabled      bool `json:"responsive_web_graphql_skip_user_profile_image_extensions_enabled"`
	FreedomOfSpeechNotReachAppealLabelEnabled                      bool `json:"freedom_of_speech_not_reach_appeal_label_enabled"`
}

type AudioSpaceByIDResponse

type AudioSpaceByIDResponse struct {
	Data struct {
		AudioSpace struct {
			Metadata struct {
				RestId                      string `json:"rest_id"`
				State                       string `json:"state"`
				Title                       string `json:"title"`
				MediaKey                    string `json:"media_key"`
				CreatedAt                   int64  `json:"created_at"`
				StartedAt                   int64  `json:"started_at"`
				EndedAt                     string `json:"ended_at"`
				UpdatedAt                   int64  `json:"updated_at"`
				DisallowJoin                bool   `json:"disallow_join"`
				NarrowCastSpaceType         int    `json:"narrow_cast_space_type"`
				IsEmployeeOnly              bool   `json:"is_employee_only"`
				IsLocked                    bool   `json:"is_locked"`
				IsSpaceAvailableForReplay   bool   `json:"is_space_available_for_replay"`
				IsSpaceAvailableForClipping bool   `json:"is_space_available_for_clipping"`
				ConversationControls        int    `json:"conversation_controls"`
				TotalReplayWatched          int    `json:"total_replay_watched"`
				TotalLiveListeners          int    `json:"total_live_listeners"`
				CreatorResults              struct {
					Result struct {
						Typename                   string `json:"__typename"`
						Id                         string `json:"id"`
						RestId                     string `json:"rest_id"`
						AffiliatesHighlightedLabel struct {
						} `json:"affiliates_highlighted_label"`
						HasNftAvatar   bool `json:"has_nft_avatar"`
						IsBlueVerified bool `json:"is_blue_verified"`
						Professional   struct {
							RestId           string        `json:"rest_id"`
							ProfessionalType string        `json:"professional_type"`
							Category         []interface{} `json:"category"`
						} `json:"professional"`
						SuperFollowEligible bool `json:"super_follow_eligible"`
						SuperFollowedBy     bool `json:"super_followed_by"`
						SuperFollowing      bool `json:"super_following"`
					} `json:"result"`
				} `json:"creator_results"`
			} `json:"metadata"`
			Sharings struct {
				Items     []interface{} `json:"items"`
				SliceInfo struct {
				} `json:"slice_info"`
			} `json:"sharings"`
			Participants struct {
				Total     int           `json:"total"`
				Admins    []User        `json:"admins"`
				Speakers  []interface{} `json:"speakers"`
				Listeners []interface{} `json:"listeners"`
			} `json:"participants"`
		} `json:"audioSpace"`
	} `json:"data"`
}

type AudioSpaceByIDVariables

type AudioSpaceByIDVariables struct {
	ID                          string `json:"id"`
	IsMetatagsQuery             bool   `json:"isMetatagsQuery"`
	WithSuperFollowsUserFields  bool   `json:"withSuperFollowsUserFields"`
	WithDownvotePerspective     bool   `json:"withDownvotePerspective"`
	WithReactionsMetadata       bool   `json:"withReactionsMetadata"`
	WithReactionsPerspective    bool   `json:"withReactionsPerspective"`
	WithSuperFollowsTweetFields bool   `json:"withSuperFollowsTweetFields"`
	WithReplays                 bool   `json:"withReplays"`
}

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient() (*Client, error)

func (*Client) GetStreamURL

func (c *Client) GetStreamURL(mediaKey string) (string, error)

func (*Client) Initialize

func (c *Client) Initialize() error

func (*Client) Query

func (c *Client) Query(name string, params []QueryParameter, out interface{}) error

type Downloader

type Downloader struct {
	Parallel int
	Done     chan struct{}
	Logger   *log.Logger
	// contains filtered or unexported fields
}

func NewDownloader

func NewDownloader(url string, outputDir string) *Downloader

func (*Downloader) Halt

func (d *Downloader) Halt()

func (*Downloader) Start

func (d *Downloader) Start(interval time.Duration)

type Errors

type Errors []struct {
	Message   string `json:"message"`
	Locations []struct {
		Line   int `json:"line"`
		Column int `json:"column"`
	} `json:"locations"`
	Extensions struct {
		Classification string `json:"classification"`
	} `json:"extensions"`
}

type LiveVideoStreamResponse

type LiveVideoStreamResponse struct {
	Source struct {
		Location              string `json:"location"`
		NoRedirectPlaybackUrl string `json:"noRedirectPlaybackUrl"`
		Status                string `json:"status"`
		StreamType            string `json:"streamType"`
	} `json:"source"`
	SessionId          string `json:"sessionId"`
	ChatToken          string `json:"chatToken"`
	LifecycleToken     string `json:"lifecycleToken"`
	ShareUrl           string `json:"shareUrl"`
	ChatPermissionType string `json:"chatPermissionType"`
}

type Metadata

type Metadata struct {
	// contains filtered or unexported fields
}

func (*Metadata) Add

func (m *Metadata) Add(k, v string)

func (*Metadata) String

func (m *Metadata) String() string

type Operation

type Operation struct {
	QueryID       string
	OperationName string
	OperationType string
}

type QueryError

type QueryError struct {
	Errors     Errors
	StatusCode int
	Status     string
}

func (*QueryError) Error

func (q *QueryError) Error() string

type QueryParameter

type QueryParameter struct {
	Name  string
	Value map[string]interface{}
}

type User

type User struct {
	PeriscopeUserId   string `json:"periscope_user_id"`
	Start             int64  `json:"start"`
	TwitterScreenName string `json:"twitter_screen_name"`
	DisplayName       string `json:"display_name"`
	AvatarUrl         string `json:"avatar_url"`
	IsVerified        bool   `json:"is_verified"`
	IsMutedByAdmin    bool   `json:"is_muted_by_admin"`
	IsMutedByGuest    bool   `json:"is_muted_by_guest"`
	UserResults       struct {
		RestId string `json:"rest_id"`
		Result struct {
			Typename                              string `json:"__typename"`
			IdentityProfileLabelsHighlightedLabel struct {
			} `json:"identity_profile_labels_highlighted_label"`
			HasNftAvatar   bool `json:"has_nft_avatar"`
			IsBlueVerified bool `json:"is_blue_verified"`
			Legacy         struct {
			} `json:"legacy"`
		} `json:"result"`
	} `json:"user_results"`
}

func GetOwnerUser

func GetOwnerUser(resp *AudioSpaceByIDResponse) *User

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL