Comment 2 for bug 673258

Revision history for this message
Emanuele FANTON (emanuele-fanton) wrote : Re: [Bug 673258] Re: doesn't update the database of game

Ciao, parli italiano?
presupponendo di si...ti dirò che secondo me ci sono problemi a livello di
wiitdb...
in effetti ho fatto un'altra modifica per usare wget al posto della libreria
python per scaricare i file...
ti interessa anche questa modifica..

2010/11/20 Gabriele Alessandrini <email address hidden>

> Dear Emanuele,
> I tried to apply the patches you posted,but I found that the size of the
> downloaded file was only 360 bytes and the zip file is instead a text file
> with the description error 403 "permission denied".
>
> I have often encountered this problem by automating procedures for
> downloading data so I decided to do a test by deriving the class
> "urllib" changing the useragent of the web request. That's the trick!
> Probably Wiitdb verifies whether the request is made by a person or a
> routine by checking the user-agent.
>
> Here's the code injected at the top of the file "util.py" (from line
> 28)
>
> class AppURLopener(urllib.FancyURLopener):
> version = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; GTB6.6;
> .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR
> 3.5.30729)"
>
> urllib._urlopener = AppURLopener()
>
> ---
> This worked for me.
>
> Now I'm trying to see if it is possible to download the zip file
> filtered only for games in WBFS partition.
>
> --
> doesn't update the database of game
> https://bugs.launchpad.net/bugs/673258
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Wiithon - WBFS Partition Manager: New
>
> Bug description:
> ubuntu 10.10
>
> Alredy contacted you for problem on lucid with sqlalchemy.. remember me?
> Now i'm on 10.10 and i had some problem updating the internal database from
> wiitdb...
> There are several problem...
> I solved them all, I hope...
> First, I'have not write permission on /usr/share/wiithon and the
> wiittdb.zip file can't be written...
> Fixed this the file dowloaded from internet have only one entry...
> I fixed the problems changing this rows on your program..
>
> file gui.py
> changed
> def ActualizarWiiTDB(self):
>
> self.poolTrabajo.nuevoTrabajoActualizarWiiTDB(self.core.prefs.URL_ZIP_WIITDB)
> # + buffer
>
> self.poolTrabajo.nuevoTrabajoActualizarWiiTDB(self.core.prefs.URL_SECOND_ZIP_WIITDB
> ) # + buffer
>
>
> file wiitdb_xml.py
> from line 98 now we have...
> newfichXML=os.path.join("/tmp",self.fichXML)
> if os.path.exists(newfichXML) and descargado_y_ok:
> xmldoc = libxml2.parseFile(newfichXML)
> ctxt = xmldoc.xpathNewContext()
> nodo = ctxt.xpathEval("//*[name() = 'datafile']")[0]
>
> if self.callback_empieza_importar:
> self.callback_empieza_importar(newfichXML)
>
> file util.py
> line 454
> zip.extract(file_out)
> TO
> zip.extract(file_out,"/tmp")
>
> file trabajo.py
> line 468
> xmlWiiTDB = WiiTDBXML(url,'wiitdb.zip','wiitdb.xml',
> TO
> xmlWiiTDB = WiiTDBXML(url,'/tmp/wiitdb.zip','wiitdb.xml',
>
>
>
> I Know now i'm going to download all the database, but now it works....
> waiting for news....bye bye
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/wiithon/+bug/673258/+subscribe
>

--
Saluti da Emanuele