Module pyreddit.services.vreddit_service

Service for v.redd.it GIFs.

Classes

class Vreddit

Service for v.redd.it GIFs.

Ancestors

Class variables

var has_external_request : bool

Inherited from: Service.has_external_request

True if the service needs to reach out to an external http endpoint, False otherwise.

var is_authenticated : bool

Inherited from: Service.is_authenticated

True if the external request needs to be authenticated (i.e. with an Authorization header), False otherwise …

var access_token : Union[str, NoneType]

Inherited from: Service.access_token

Contains the access token for the OAuth authentication if present, None otherwise …

Static methods

def preprocess(url: str, data: Any) ‑> str

Override of Service.preprocess() method.

Tries to get the right media url from the reddit json.

Reddit APIs are known to be unreliable in positioning the information needed, therefore we need to seach in the json for the correct piece of information in every specific case.

def postprocess(response) ‑> Media

Override of Service.postprocess() method.

Constructs the media object.

def get(url: str) ‑> Union[requests.models.Response, str]

Inherited from: Service.get

Get the media information …

def authenticate() ‑> NoneType

Inherited from: Service.authenticate

Authenticate the service on the service provider API …

def get_media(url: str, data: Any) ‑> Media

Inherited from: Service.get_media

Entrypoint of the class …