DFofanov 0 Posted March 9, 2020 Share Posted March 9, 2020 Доброго времени суток знатоки!Подскажите пожалуйста, через какую команду (набор команд) API можно закачать в Emby Server данные о видео (Размер, длительность, качество и т.д.)?При первом запуске фильма Emby получает данные от файла и хранит их в блоке INFO, можно ли закачать эти данные один раз но для всех фильмов сразу? Спасибо за помощь! @@chef Link to comment Share on other sites More sharing options...
chef 3744 Posted March 9, 2020 Share Posted March 9, 2020 Hi there.I believe you are asking the best way to gather movie information from the API (all at once), is this correct?You'll want to create an ItemQuerywith a 'Type' of 'Movie', and give that query to an ApiClient object.This will return all movie items in list as a result.Please let me know if I have misinterpreted your question, and I'll gladly try again to answer it properly. @@rechigo @@chef Link to comment Share on other sites More sharing options...
DFofanov 0 Posted March 10, 2020 Author Share Posted March 10, 2020 (edited) @@rechigo @@chef Добрый день, Chef Я спрашивал о команде PlaybackInfo Меня интересовала эта команда: https://server/emby/Items/293102/PlaybackInfo?UserId=....&StartTimeTicks=0&IsPlayback=false&AutoOpenLiveStream=false&MaxStreamingBitrate=1500000 Edited March 19, 2020 by Luke Link to comment Share on other sites More sharing options...
DFofanov 0 Posted March 10, 2020 Author Share Posted March 10, 2020 @@rechigo @@chef Разобрался в данном вопросе, вот накидал небольшой код на python-e Задача: Загрузить данные о медиафайле. import requests import logging import json import os def get_request_emby(url): try: try: r = requests.get(url, headers=headers, timeout=60, stream=True) if r.ok: json_result = r.json() finally: r.connection.close() r.close() except: pass return json_result def get_emby_video_info(ip, apy_key): url = "http://" + ip + ":8096/emby/Items?api_key=" + apy_key + "&SortBy=PremiereDate%2CProductionYear%2CSortName&SortOrder=Descending&IncludeItemTypes=Movie&Recursive=true&Fields=BasicSyncInfo%2CMediaSourceCount%2CSortName%2CPrimaryImageAspectRatio%2CProductionYear&ImageTypeLimit=1&EnableImageTypes=Primary%2CBackdrop%2CThumb&StartIndex=0&Limit=1000&ParentId=1d342f3d0fe54cbeb251f22db1a62a35&GroupItemsIntoCollections=true" items = get_request_emby(url) for item in items['Items']: if item != None: url = "http://" + ip + ":8096/emby/Items/" + item['Id'] + "/PlaybackInfo?api_key=" + apy_key + "&StartTimeTicks=0&IsPlayback=false&AutoOpenLiveStream=false" mediaSources = get_request_emby(url) log.info("ID: " + item['Id'] + ", NAME: " + item['Name'] + ", PlaySessionId: " + mediaSources['PlaySessionId']) def main(): get_emby_video_info('emby ip','apy_key') if __name__ == '__main__': main() Link to comment Share on other sites More sharing options...
rechigo 293 Posted April 8, 2020 Share Posted April 8, 2020 (edited) I manually sent the requests to the endpoints via an http client and I get back media info just fine, so this must be something with your python code (code throws errors when running) I don't know much about python and I don't believe chef does either @@TeamB might have some tips for you Edited April 8, 2020 by rechigo Link to comment Share on other sites More sharing options...
TeamB 2349 Posted April 8, 2020 Share Posted April 8, 2020 Fields=MediaStreams Link to comment Share on other sites More sharing options...
Luke 36887 Posted April 9, 2020 Share Posted April 9, 2020 Please let us know if this helps. Thanks ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now