[RELEASE] Texture Cache Maintenance utility - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116) +--- Thread: [RELEASE] Texture Cache Maintenance utility (/showthread.php?tid=158373) Pages:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
RE: [RELEASE] Texture Cache Maintenance utility - BuckyKattNJ - 2017-01-12 Hello. I am trying to get texturecache.py working... but its not doing what I need. I use Kodi mostly as a DLNA/UPNP server, and I need it to automagically cache thumbnails for mp3s I add without going into Kodi and browsing manually. All my music has thumbnails in the files and they are the only thumbs I want cached... no scraping or folder.jpg files (actually a few are present, but I'm weeding them out). I have fiddled with the example .cfg and it is kinda working... but when I do a: ./texturecache.py c songs Or a: ./texturecache.py C songs It cranks along for a while and the summary shows it deleted 14, cached 14 (which seem to correspond to the folder.jpg/cover.jpgs that are present), it then finds like 10000 duplicates and 1000 ignored... which I imagine are my in-file thumbnails for about 1000 albums and 10000 songs. What do I need to set to get it cache the in-file thumbs so I see album artwork via DLNA/UPNP? IIRC, the only things I changed in the .cfg are: allow.recacheall=yes userdata = ~/.kodi/userdata webserver.port = 80 qa.art.songs = thumbnail I'm running OpenELEC 7.0 with Kodi 16.1 on a RPi2. Thanks, BKNJ RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2017-01-12 Embedded artwork is not supported by this script as there's no mechanism to force caching of such artwork. If you enable the logfile (@logfile=/tmp/tc.log) you'll see entries written to the log that provide details of the files being ignored, including why they were ignored - these will be your music files with embedded artwork. The only way to cache this artwork is to view them in the GUI as it's a GUI process that extracts the artwork from the file. You don't need to set the userdata property - the value you're using is already the default (both ~/.kodi and ~/.xbmc are supported). RE: [RELEASE] Texture Cache Maintenance utility - BuckyKattNJ - 2017-01-12 Argh! I misunderstood and thought this was the original point to the script... reading different posts in the way, wayback. I guess I may have to write my own script to kind-of automate this... I know that I can stimulate Kodi to cache the embedded artwork via Chorus... by basically repeatedly calling http://127.0.0.1/#artist/n, where n=1 to infinity... I just have to write some scrape code to detect when it runs out of artists. Knowing that texturecache.py is also poking the same webserver port, I'm curious how requests are being routed to Kodi or to Chorus. I've never really poked and prodded the web server config, which I imagine is kernel-based. BKNJ RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2017-01-12 That is the point of the script, but because embedded artwork has to be extracted from the media file before it can be displayed I haven't yet found a method for automating the caching of these embedded images - any attempt to view (download) the uncached embedded artwork will usually fail as the only url Kodi has at this time is either a video or audio file and not an image file. If you find a solution, please share! RE: [RELEASE] Texture Cache Maintenance utility - BuckyKattNJ - 2017-01-13 Well, I see a solution, as I've written lots of scrapers... but trying to use Perl LWP with JSON is something I'm not used to working with. Where does Kodi generally hide the .js files for the various web front ends? I imagine I'm going to have to start there to get an idea of the data sent back and forth. I wish I had some http sniffing tools ready to go... that would likely clue me in quite a bit faster. Interestingly, it appears using the default web interface and clicking on Music caches all my music thumbnails without any further intervention... but its taking forever. I'll have to give an hour and then try out my DLNA/UPNP app. BKNJ RE: [RELEASE] Texture Cache Maintenance utility - User 224999 - 2017-01-13 (2017-01-12, 23:35)Milhouse Wrote: That is the point of the script, but because embedded artwork has to be extracted from the media file before it can be displayed I haven't yet found a method for automating the caching of these embedded images - any attempt to view (download) the uncached embedded artwork will usually fail as the only url Kodi has at this time is either a video or audio file and not an image file. If you find a solution, please share! What I did in the past is just call the image through the webinterface (not json api!) and that seemed to work well: A simple head request is enough to trigger the internals to go fetch the image and put it in the cache. Code snippet: PHP Code: requests.head( Where the image url is the full image path you get from the json API. Or is this something you already tried ? EDIT: I must also say that you can see in the above snippet it uses an extremely short timeout as we don't want the results. You must however notice that the webserver cannot handle a lot of requests at the same time. In the Emby addon (where I implemented this back than) we have a limiter of maximum 25 requests at the same time and that seems to go well even on low power machines. RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2017-01-13 What I remember (it was a long time ago) was that it would sometimes work when the artwork is embedded, but wasn't terribly reliable, which is why in the end I decided to cut my losses and disable support for embedded artwork. I did query the process with the Kodi developers who informed me that the extraction of a embedded artwork was connected to a GUI process and unlikely to be supported by JSON (and presumably web ui). I'm going to be short of time to look into this for the next couple of weeks but assuming I find the time in the near future will take another look. RE: [RELEASE] Texture Cache Maintenance utility - BuckyKattNJ - 2017-01-14 After pulling apart the JSON and Chorus using the Chrome developer tools, I now see, that the combination of the jsonrpc call and the GET on the image is what Chorus does... and this somehow makes Kodi cache the image... but seemingly only from Chrome. Using cURL and wget to do the same thing fails... then I realized Chrome was double encoding the special characters. Double encoded the URL and fed it into wget... and bam, it worked. I coded up something permanent in Perl and now all my embedded artwork is cached. Its basically what marcelveldt was describing. Sorry, its in Perl... Hope this helps someone. Code: #!/usr/bin/perl BKNJ RE: [RELEASE] Texture Cache Maintenance utility - Uatschitchun - 2017-01-15 Hi there, I get the following: Code: LibreELEC:~ # ./texturecache.py c Any suggestions? RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2017-01-15 @Rusendusen can you enable logging by adding "@logfile=/tmp/tc.log" to your command line then send me a link to your tc.log file. RE: [RELEASE] Texture Cache Maintenance utility - Uatschitchun - 2017-01-16 Here you are: http://sprunge.us/YbWj RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2017-01-16 (2017-01-16, 14:18)Rusendusen Wrote: Here you are: Thanks. For some reason some of your TV channels don't have a "channelid" property. Can you try this version of texturecache.py and let me know if it works OK: http://sprunge.us/HZFE If not please upload another logfile. RE: [RELEASE] Texture Cache Maintenance utility - Uatschitchun - 2017-01-16 Working! Thank you! Another short question: I'd like to maintain my clients (all have 3 profiles including master). Therefore, I added sections to cfg. For the master profile no section is needed when using local on the clients. Nevertheless, is there a performance issue when using texturecache over network? I don't know if I use texturecache only locally or from one PC over network with xbmc.host not being localhost...? RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2017-01-16 (2017-01-16, 16:44)Rusendusen Wrote: Working! Thank you! Thanks, I'll push a new version shortly. Edit: New version v2.3.5 pushed. (2017-01-16, 16:44)Rusendusen Wrote: Nevertheless, is there a performance issue when using texturecache over network? It's probably a little slower, depending on how much data has to be transferred over the network, but I wouldn't expect it to be noticeably slower. However running the script over the network from a central machine to each of your clients is usually a lot more convenient, and worth any slight increase in run time. RE: [RELEASE] Texture Cache Maintenance utility - Milhouse - 2017-01-16 You don't need to set userdata at all - let the script work it out if possible. You only need to set it if it's compeletely non-standard. If you're using profiles you need the script to switch the profile for you (which automatically recalculates userdata etc.), so that Kodi is reading the correct database(s) for the profile you are querying. Add "profile.name=<profilename>" to your sections (the master profile has the name "Master user") and the script will instruct Kodi to switch profile whenever the required profile is not already loaded. Whether Kodi then works afterwards is impossible to say...it may do if you're lucky - profiles are very "fragile". BTW, another way to write your config would be: Code: checkupdate = yes and now your default section is "Master". If Kodi has the Master profile loaded then "texturecache.py @section=fanny stats" would unload the "Master user" profile, load the "fanny" profile, and query the databases for the fanny profile. Kodi will be left with the "fanny" profile loaded, so if you then run "texturecache.py stats" it will unload the "fanny" profile, load the "Master user" profile, and query the databases for the Master user profile. |