Ext: sg_youtube
License: GNU GPL, Version 2
Repository: https://gitlab.sgalinski.de/typo3/sg_youtube
Please report bugs here: https://gitlab.sgalinski.de/typo3/sg_youtube
TYPO3 version: >9.5
Installation / Integration
First install the extension and activate it in the Extension Manager.
TypoScript integration
- Include the TypoScript in Configuration/TypoScript/setup.typoscript and constants.typoscript in your theme.
- Add your Youtube API key:
plugin.tx_sgyoutube {
settings {
# cat=plugin.tx_sgyoutube/file; type=string; label=YouTube API Key
apiKey = <your-api-key>
}
}
Registration for more than the free 10.000 quotas per day
It's not 1 quota per 1 api call. Each api has it's own costs, which can be seen in the link below.
Currently at the version 3.2.1 we are using the following apis:
- "search/list" for channel videos
- "playlistItems/list" for videos from a specific playlist
- "videos/list" for getting the details for each video and the localizations, if needed.
The maximum quota costs would be "102" at the moment for rendering the latest videos from a channel with the video details and translations.
YouTube API Services - Audit and Quota Extension Form
Caching behaviour
Because of the quota costs we implemented a caching for the calls for each day. The response from the apis will be saved and used for 24 hours. Normally the site cache would do it, but it could be, that the cache will be cleared multiple times in a row, or that the plugin is on an uncached page. The TYPO3 registry is used as a cache. The cleanup will is handled on the fly.
If the "?disableYoutubeCache=1" parameter is added to the url, this cache will be ignored as well.
Possible way to solve the quota limit, if it's still reached
You can use a different api-key for specific sites. You can implement a TypoScript page uid check and just change the key from the "TypoScript integration" topic.