Repository: youtube-dl
Issue: TypeError: Struct() argument 1 must be string, not unicode
Labels: cant-reproduce

## Please follow the guide below

- You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly
- Put an `x` into all the boxes [ ] relevant to your *issue* (like that [x])
- Use *Preview* tab to see how your issue will actually look like

---

### Make sure you are using the *latest* version: run `youtube-dl --version` and ensure your version is *2017.07.09*. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2017.07.09**

### Before submitting an *issue* make sure you have:
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones

### What is the purpose of your *issue*?
- [x] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---

### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your *issue*

---

### If the purpose of this *issue* is a *bug report*, *site support request* or you are not completely sure provide the full verbose output as follows:

Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```):
```
     import youtube_dl
  File "/usr/lib/python2.7/site-packages/youtube_dl/__init__.py", line 15, in <module>
    from .options import (
  File "/usr/lib/python2.7/site-packages/youtube_dl/options.py", line 8, in <module>
    from .downloader.external import list_external_downloaders
  File "/usr/lib/python2.7/site-packages/youtube_dl/downloader/__init__.py", line 3, in <module>
    from .common import FileDownloader
  File "/usr/lib/python2.7/site-packages/youtube_dl/downloader/common.py", line 10, in <module>
    from ..utils import (
  File "/usr/lib/python2.7/site-packages/youtube_dl/utils.py", line 65, in <module>
    from .socks import (
  File "/usr/lib/python2.7/site-packages/youtube_dl/socks.py", line 29, in <module>
    SOCKS4_DEFAULT_DSTIP = compat_struct_pack('!BBBB', 0, 0, 0, 0xFF)
TypeError: Struct() argument 1 must be string, not unicode
```

---

### Description of your *issue*, suggested solution and other information

I tried to embed youtube-dl in my code. But got this error `TypeError: Struct() argument 1 must be string, not unicode`.
This error found in python **2.7.5**. I run the script in python **2.7.9**, it's no problem, it works fine.
I think it's about string vs unicode type.
For other information, maybe this is related to this issue https://stackoverflow.com/questions/26008272/string-vs-unicode-encoding-struct-argument

Thank you