No, never assume that the package_id has any syntactical correspondance to the course_id. You can, however, use updates_locator to get the package_id and branch.