TOOLSP
"
WELCOME !

Please ! USE [CODE] tags for your LINKS and CODE.

Favor usar balisas [CODE] para sus vínculos y código.

Merci d'utiliser les balises [CODE] pour vos liens et code.


[code]http://Thank.you[/code]
"
*** Doc. Kodi & PYthon ***
.
.
Python & Modules PY
.
.
.
.
(Video) Cache Kodi
.
.
.
Addons Kodi
.
.
.
Addons Kodi
.
.
*** GITHUB ***
.
.
URLresolver (J.S.) [GIT] +
.
.
.
URLresolver (elD.) [GIT] -
.
.
URLresolver (tvA.) [GIT] -
.
.
.
.
Cloudflare (external) [GIT]
.
.
.
*** Associated ***
.
Pastebin Your list online
.
mediafire Upload Files
.
imgur Upload Pics
lyngsat TV logos collection
transparent .png
.
http://hola.org free? VPN
Hola.apk free? VPN App.
.
hidester- free Proxy
.
webgrabplus EPG - Eng
xmltv EPG - Fr
kazer EPG - Fr
.
.wordreference Traduction
.
mail.com (fast sign-in)
.
.
FRIENDS / PARTNERS

£$π community

créer un forum


please help for modify £$π

Go down

please help for modify £$π

Post by vbprofi on Fri 27 Apr - 9:40

Hello experts,
today I will modify £$π for any friends. I will give my friends an installation package with preconfigured £$π. they have to install the ZIP and have to start.
If I put the resorce_file in the resorce folder of the ZIP-Package, that don't work.
Have someone an Idea, how I can do that?

My Idea: write in the default.py of the package this code, for copying the resorce_file fom addon installfolder to userdata addonfolder.
Code:

#original file
of = xbmc.translatePath("special://addons/plugin.video.live.streamspro/resources/source_file")
#copy to
ct = xbmc.translatePath("special://userdata/addon_data/plugin.video.live.streamspro/source_file")

fo = open(of)
text = fo.read()
fo.close()

fo = open(ct,"w")
fo.write(text)
fo.close()
My problem is, I don't know, where in the default.py I have write the code. Have someone Ideas?


Last edited by vbprofi on Fri 27 Apr - 13:21; edited 1 time in total (Reason for editing : update path)

vbprofi

Messages : 40
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: please help for modify £$π

Post by kabcasa on Fri 27 Apr - 13:09

directory userdata/addon_data/plugin.video.live.streamspro/resources/ doesn't exit ?

kabcasa

Messages : 17
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: please help for modify £$π

Post by vbprofi on Fri 27 Apr - 13:19

if you click on kodi videos > video addons and open contextmenü of £$π and click settings, go to register source and add url, so in userdata/addon_data/plugin.video.live.streamspro/ £$π create an new file with the new url in "source_file".

vbprofi

Messages : 40
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: please help for modify £$π

Post by kabcasa on Fri 27 Apr - 14:08

i mean to you resources directory


Last edited by kabcasa on Fri 27 Apr - 14:24; edited 1 time in total

kabcasa

Messages : 17
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: please help for modify £$π

Post by vbprofi on Fri 27 Apr - 14:20

at the installationspackage the resources folder is exists. In /resources/ I have two files (settings.xml and source_file)after the installation you find the folder resources in addons/plugin.video.live.streamspro. But I will copy the source_file from resources to userdata/addon_data/plugin.video.live.streamspro/source_file. the resources folder don't need in userdata/addon_data/plugin.video.live.streamspro/. you can show the above code in my first post.

vbprofi

Messages : 40
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: please help for modify £$π

Post by kabcasa on Fri 27 Apr - 14:32

your first post
Last edited by vbprofi on Fri 27 Apr - 12:21; edited 1 time in total (Reason for editing : update path)



kabcasa

Messages : 17
Date d'inscription : 2017-04-17

View user profile

Back to top Go down

Re: please help for modify £$π

Post by vbprofi on Fri 27 Apr - 14:43

I have update this part
Code:

ct = xbmc.translatePath("special://userdata/addon_data/plugin.video.live.streamspro/source_file")
do you have an Idea or a solution for this problem?

vbprofi

Messages : 40
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: please help for modify £$π

Post by vbprofi on Mon 30 Apr - 4:58

gives no idea?

vbprofi

Messages : 40
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: please help for modify £$π

Post by jujuuj on Wed 2 May - 19:49

fo = open(of, 'r')


#original file
of = xbmc.translatePath("special://addons/plugin.video.live.streamspro/resources/source_file")
#no idea...#

#copy to
#ct = xbmc.translatePath("special://userdata/addon_data/plugin.video.live.streamspro/source_file")
ct = xbmc.translatePath("special://profile/addon_data/" + "plugin.video.live.streamspro/" + "source_file")

addon = xbmcaddon.Addon('plugin.video.live.streamspro')
addon_version = addon.getAddonInfo('version')
profile = xbmc.translatePath(addon.getAddonInfo('profile').decode('utf-8'))


fo = open(of, 'r')
text = fo.read()
fo.close()

fo = open(ct,'w')
fo.write(text)
fo.close()

Question
avatar
jujuuj

Messages : 189
Date d'inscription : 2017-03-28

View user profile

Back to top Go down

Re: please help for modify £$π

Post by vbprofi on Thu 3 May - 0:53

I have put on Line 51 in default.py after the line
Code:

home = xbmc.translatePath(addon.getAddonInfo('path').decode('utf-8'))
this code
Code:

### start modification ###
if not os.path.exists(profile):
        os.makedirs(profile)
fo = open(home + '\\resources\\source_file', 'r')
text = fo.read()
fo.close()
fo = open(profile + 'source_file','w')
fo.write(text)
fo.close()
### end modification ###       

that is working know. The Problem are fixing by \\ on the path.
thanks for your help!

vbprofi

Messages : 40
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: please help for modify £$π

Post by Admin on Thu 3 May - 18:03

Glad it works
now please can you explain me what is the interest in changing the directory ?

actually, i dont understand why did you needed de \\ ...
are you under windows ?

Admin

Messages : 49
Date d'inscription : 2017-03-28

View user profile http://toolsp.forumactif.com

Back to top Go down

Re: please help for modify £$π

Post by vbprofi on Thu 3 May - 18:57

I need the configfile source_file from £$π for friends, who can't install addons and configure that. So I install them an preconfigured addon. After the installation the configfile source_file will copy automaticly to the profile folder from £$π. So people haven't need do anything and can start.
In the source_file Configfile I have saved a very long Url ;-) It is not handy to write it self.
If the free webspace have a problem or that wasn't work I can update the XML-File, who's url is saved in source_file of modificated £$π and people haven't need do anything.

I likes automatic. that saved a lot of time.

I works under Ubuntu 14.04 5 lts and tested Kodi 17.6 on windows 10.

vbprofi

Messages : 40
Date d'inscription : 2017-05-03

View user profile

Back to top Go down

Re: please help for modify £$π

Post by Admin on Thu 3 May - 20:43

Smile

Admin

Messages : 49
Date d'inscription : 2017-03-28

View user profile http://toolsp.forumactif.com

Back to top Go down

Re: please help for modify £$π

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum