Skip to content
This repository has been archived by the owner on May 28, 2022. It is now read-only.

YT uploader: no appropriate stream found #545

Open
dideler opened this issue Apr 6, 2014 · 4 comments
Open

YT uploader: no appropriate stream found #545

dideler opened this issue Apr 6, 2014 · 4 comments

Comments

@dideler
Copy link
Member

dideler commented Apr 6, 2014

Should we handle this error better?

↪ file ~/Videos/TEST-UCOSPM.ogg ~/Videos/FOO.ogg
/home/dennis/Videos/TEST-UCOSPM.ogg: Ogg data, Theora video
/home/dennis/Videos/FOO.ogg:         empty
↪ python -m freeseer upload youtube ~/Videos/FOO.ogg ~/Videos/TEST-UCOSPM.ogg
Found videos:
/home/dennis/Videos/TEST-UCOSPM.ogg
/home/dennis/Videos/FOO.ogg
Are you sure you would like to upload these videos? [Y/n]
2014-04-06 13:54:28,866 (    INFO) apiclient.discovery                     : URL being requested: https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest
2014-04-06 13:54:29,545 (    INFO) apiclient.discovery                     : URL being requested: https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&alt=json&part=snippet%2Cstatus
2014-04-06 13:54:29,546 (    INFO) freeseer.framework.youtube              : Uploading /home/dennis/Videos/TEST-UCOSPM.ogg
The file was successfully uploaded with video id: 1cdVYBk5aoY
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/dennis/github/freeseer/src/freeseer/__main__.py", line 27, in <module>
    main()
  File "freeseer/__init__.py", line 100, in main
    cli.parse_args(parser)
  File "freeseer/frontend/cli.py", line 243, in parse_args
    youtube.upload(args.files, args.token, args.yes)
  File "freeseer/frontend/upload/youtube.py", line 122, in upload
    response_code, response = youtube_service.upload_video(video)
  File "freeseer/framework/youtube.py", line 174, in upload_video
    metadata = self.get_metadata(video_file)
  File "freeseer/framework/youtube.py", line 138, in get_metadata
    tags = oggvorbis.Open(video_file)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/__init__.py", line 84, in __init__
    self.load(filename, *args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/mutagen/ogg.py", line 465, in load
    raise self._Error, "no appropriate stream found"
mutagen.oggvorbis.OggVorbisHeaderError: no appropriate stream found

cc @MadMub

@MadMub
Copy link
Member

MadMub commented Apr 6, 2014

I've never encountered this before, I think mutagen couldnt read the ogg to
get the metadata, I think what I will do is if mutagen encounters errors I
will just return default metadata, can u open an issue for this, I don't
think I can recreate it.
On Apr 6, 2014 2:01 PM, "Dennis Ideler" notifications@github.com wrote:

Should we handle this error better?

↪ file ~/Videos/TEST-UCOSPM.ogg ~/Videos/FOO.ogg
/home/dennis/Videos/TEST-UCOSPM.ogg: Ogg data, Theora video
/home/dennis/Videos/FOO.ogg: empty
↪ python -m freeseer upload youtube ~/Videos/FOO.ogg ~/Videos/TEST-UCOSPM.ogg
Found videos:
/home/dennis/Videos/TEST-UCOSPM.ogg
/home/dennis/Videos/FOO.ogg
Are you sure you would like to upload these videos? [Y/n]
2014-04-06 13:54:28,866 ( INFO) apiclient.discovery : URL being requested: https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest
2014-04-06 https://www.googleapis.com/discovery/v1/apis/youtube/v3/rest2014-04-06 13:54:29,545 ( INFO) apiclient.discovery : URL being requested: https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&alt=json&part=snippet%2Cstatus
2014-04-06 https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&alt=json&part=snippet%2Cstatus2014-04-06 13:54:29,546 ( INFO) freeseer.framework.youtube : Uploading /home/dennis/Videos/TEST-UCOSPM.ogg
The file was successfully uploaded with video id: 1cdVYBk5aoY
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/dennis/github/freeseer/src/freeseer/main.py", line 27, in
main()
File "freeseer/init.py", line 100, in main
cli.parse_args(parser)
File "freeseer/frontend/cli.py", line 243, in parse_args
youtube.upload(args.files, args.token, args.yes)
File "freeseer/frontend/upload/youtube.py", line 122, in upload
response_code, response = youtube_service.upload_video(video)
File "freeseer/framework/youtube.py", line 174, in upload_video
metadata = self.get_metadata(video_file)
File "freeseer/framework/youtube.py", line 138, in get_metadata
tags = oggvorbis.Open(video_file)
File "/usr/local/lib/python2.7/dist-packages/mutagen/init.py", line 84, in init
self.load(filename, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/mutagen/ogg.py", line 465, in load
raise self._Error, "no appropriate stream found"
mutagen.oggvorbis.OggVorbisHeaderError: no appropriate stream found

cc @MadMub https://github.com/MadMub


Reply to this email directly or view it on GitHubhttps://github.com//issues/545
.

@dideler
Copy link
Member Author

dideler commented Apr 6, 2014

@MadMub that's right, it can't read the file to get the metadata. Take a look at the first command I used. The file FOO.ogg isn't a valid Ogg file. In this case it would be better to skip the file (and properly notify the user) instead of using default metadata and trying to upload the file, which will likely be rejected by YouTube anyway.

@MadMub
Copy link
Member

MadMub commented Apr 6, 2014

oh, so you just named a file foo.ogg, and tried to upload it. File checking simply checks the extension, do you really see the user making fake video files?

@dideler
Copy link
Member Author

dideler commented Apr 6, 2014

I don't remember how I made the file (was a long time ago), but I don't think I simply did touch FOO.ogg. IIRC it was a recording gone bad. So the user may not have the intention to upload fake files.

It's okay if extracting the metadata fails (and checking the file extension is good enough for now), I just think we can handle this error better as suggested in my previous comment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants