google-code-export / django-syncr

Automatically exported from code.google.com/p/django-syncr
0 stars 0 forks source link

Youtube: syncUserFavorites() does not work #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

>>> from syncr.app.youtube import YoutubeSyncr
>>> yt = YoutubeSyncr()
>>> yt.syncUserFavorites("winterweaver")

What is the expected output? What do you see instead?
I'm expecting it to sync, but I get:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File
"/home/andre/Projects/gamblehuis/buildout-gamblehuis/apps/django-syncr/src/syncr
/app/youtube.py",
line 202, in syncUserFavorites
    result =
self._request('http://'+self._youtubeGDataHost+self._youtubeFeedBase+'users/%s/f
avorites'
% username)
  File
"/home/andre/Projects/gamblehuis/buildout-gamblehuis/apps/django-syncr/src/syncr
/app/youtube.py",
line 40, in _request
    tree = ET.parse(f)
  File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 862, in parse
    tree.parse(source, parser)
  File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 586, in parse
    parser.feed(data)
  File "/usr/lib/python2.6/xml/etree/ElementTree.py", line 1245, in feed
    self._parser.Parse(data, 0)
ExpatError: syntax error: line 1, column 0

What version of the product are you using? On what operating system?
Using the latest version, but modified the save method on the video model,
due to the force_insert issue.

Original issue reported on code.google.com by litt.fir...@gmail.com on 22 Dec 2009 at 2:17

GoogleCodeExporter commented 9 years ago
Note that syncUserPlaylist() does work. But in this particular use case the 
client
wants to sync favorites

Original comment by litt.fir...@gmail.com on 22 Dec 2009 at 2:22

GoogleCodeExporter commented 9 years ago
I ran into this too - from what I can tell ExpatErrors are usually caused by 
unicode
characters in the xml (causing it to be not well-formed)

I am catching the error and skipping the videos that throw the error, but let 
me know
if you find a better workaround

Original comment by Jim.mixt...@gmail.com on 6 Jan 2010 at 5:55