A Wrapper for Hermicraft Video API
Project description
Hermitcraft Video API
This is a python wrapper for the Hermitcraft.com api, that supports retrieving data for hermits and their videos.
The Site was created by hypnotised, and the api is used within the site to get the latest videos and see when hermits are live. This uses those api endpoints allowing us to get the data that the site uses.
Getting started
Go ahead and import the library.
import hermitcraftvideos
Next, we get a hermit from the api. Let's use Xisumavoid for this example.
hermit = hermitcraftvideos.getHermit("xisumavoid")
Make sure that you use the right name. It needs to be the EXACT channel name in the youtube URL in lower case. Example: Mumbo --> https://www.youtube.com/user/ThatMumboJumbo --> thatmumbojumbo
How we have our hermit from the api, we can find out data.
Such as a profile picture
print(hermit.picture) #https://yt3.ggpht.com/-x5tq4dTokyM/AAAAAAAAAAI/AAAAAAAAAAA/x4s30KOqUVA/s88-c-k-no/photo.jpg
Or we can find out a twitter:
print("@{} - {}".format(hermit.twitter.name,hermit.twitter.url)) #@xisumavoid - https://twitter.com/xisumavoid
Or better, if they are live on youtube, twitch or mixer(beam)
print(hermit.youtube.live) #False
print(hermit.twitch.live) #True
print(hermit.mixer.live) #False
We can also get videos!
videos = hermit.getVideos()
You can get simple data from the video
video = videos[0]
print(video.title) #Hermitcraft VI 712 Already Its The End!
And Some handy data
print("video is {} mins long".format(video.duration_time)) #video is 22:49 mins long
print("uploaded {}".format(video.uploaded_time)) #uploaded 7 hours ago
Oooooh. Statistics
print(video.views) #44430
print(video.likes) # 2785
Oooooooooooooooooooooooooooooooooooooh. Updated Statistics
video.update()
print(video.views) #44440
print(video.likes) # 2790
And That's Mostly it. You can also get a jumble of videos with
hermitcraftvideos.getLatestVideos()
API Reference
Soon!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hermitcraftvideos-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49e96945ce52f15741b9d5c8e6728ab269a8820c9704b72fcbbdd06723c509e3 |
|
MD5 | 23f0fc6f94925b83a1ac18c1aa7b7201 |
|
BLAKE2b-256 | 673903d7c9ea6dc100155ac5fad39b6c3c11466ade78385d5e5eeae798728c13 |